From 83e8a84222159ed87df02d8aa0e3cadef5925281 Mon Sep 17 00:00:00 2001 From: Adrian Serapio Date: Sun, 8 Dec 2019 11:15:59 +0800 Subject: [PATCH 1/3] Added SMTP Send Test --- tests/testthat/test-smtp_send.R | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/testthat/test-smtp_send.R diff --git a/tests/testthat/test-smtp_send.R b/tests/testthat/test-smtp_send.R new file mode 100644 index 00000000..3db2e0f1 --- /dev/null +++ b/tests/testthat/test-smtp_send.R @@ -0,0 +1,32 @@ +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(create_smtp_creds_file( + file = "test_creds_file", + user = "sender@email.com", + provider = "gmail")) + + 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" + )) +}) From 32a87d7183502ed2878614243d1c27c0f68b6af5 Mon Sep 17 00:00:00 2001 From: Adrian Serapio Date: Sun, 8 Dec 2019 11:22:18 +0800 Subject: [PATCH 2/3] Updated Codecov to Track Code Coverage Changes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From ffada9533bbef86272bc99673dee677369e178ce Mon Sep 17 00:00:00 2001 From: Adrian Serapio Date: Tue, 10 Dec 2019 06:43:56 +0800 Subject: [PATCH 3/3] Updated to Pass Checks --- tests/testthat/test-smtp_send.R | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/testthat/test-smtp_send.R b/tests/testthat/test-smtp_send.R index 3db2e0f1..626996d8 100644 --- a/tests/testthat/test-smtp_send.R +++ b/tests/testthat/test-smtp_send.R @@ -9,10 +9,9 @@ test_that("Creds File Deprecation", { email <- compose_email("email") - cf <- creds_file(create_smtp_creds_file( - file = "test_creds_file", - user = "sender@email.com", - provider = "gmail")) + cf <- creds_file( + file = "test_creds_file" + ) expect_error(smtp_send(email=email, from = "sender@email.com",to = "recipient@email.com", creds_file = cf))