From 102154d3fef61f13e71acf58fe662bd7acef187f Mon Sep 17 00:00:00 2001 From: Scott Chamberlain Date: Thu, 3 Jan 2019 10:14:18 -0800 Subject: [PATCH] fix #294 fix to arc2 test - us Sys.Date to get last year, instead of hard coding --- tests/testthat/test-arc2.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/testthat/test-arc2.R b/tests/testthat/test-arc2.R index 3edb4064..38a3bb54 100644 --- a/tests/testthat/test-arc2.R +++ b/tests/testthat/test-arc2.R @@ -8,7 +8,8 @@ test_that("arc2 returns the expected output", { test_that("arc2 fails with appropriate error messages", { expect_error(arc2(date = 19830101), "must be of class character, Date") - expect_error(arc2(date = "1978-01-01"), "must be between 1979 and 2018") + expect_error(arc2(date = "1978-01-01"), + paste0("must be between 1979 and ", format(Sys.Date(), "%Y"))) expect_error(arc2(date = "1983-13-01"), "must be between 1 and 12") expect_error(arc2(date = "1983-01-32"), "must be between 1 and 31") })