diff --git a/README.md b/README.md index cf9602cc..95c4ce22 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/tests/testthat/test-smtp_send.R b/tests/testthat/test-smtp_send.R new file mode 100644 index 00000000..626996d8 --- /dev/null +++ b/tests/testthat/test-smtp_send.R @@ -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 = "sender@email.com",to = "recipient@email.com", + creds_file = cf)) +}) + +test_that("Credentials is NULL", { + email <- compose_email("email") + expect_error(smtp_send(email, from = "sender@email.com",to = "recipient@email.com", credentials=NULL)) +}) + + +test_that("Credentials is Blastula class", { + + expect_error(smtp_send(from = "sender@email.com",to = "recipient@email.com", + "hello" + )) +})