Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMTP-send-email tests #130

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ status](https://www.r-pkg.org/badges/version/blastula)](https://CRAN.R-project.o
[![Travis-CI Build
Status](https://travis-ci.org/rich-iannone/blastula.svg?branch=master)](https://travis-ci.org/rich-iannone/blastula)
[![Codecov test
coverage](https://codecov.io/gh/rich-iannone/blastula/branch/master/graph/badge.svg)](https://codecov.io/gh/rich-iannone/blastula?branch=master)
coverage](https://codecov.io/gh/pilipino/blastula/branch/master/graph/badge.svg)](https://codecov.io/gh/pilipino/blastula?branch=master)

## Overview

Expand Down
31 changes: 31 additions & 0 deletions tests/testthat/test-smtp_send.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
context("SMTP send")

test_that("Email is of expected format", {
# Illegal inputs
expect_error(smtp_send("hello"))
})

test_that("Creds File Deprecation", {

email <- compose_email("email")

cf <- creds_file(
file = "test_creds_file"
)

expect_error(smtp_send(email=email, from = "[email protected]",to = "[email protected]",
creds_file = cf))
})

test_that("Credentials is NULL", {
email <- compose_email("email")
expect_error(smtp_send(email, from = "[email protected]",to = "[email protected]", credentials=NULL))
})


test_that("Credentials is Blastula class", {

expect_error(smtp_send(from = "[email protected]",to = "[email protected]",
"hello"
))
})