diff --git a/tests/testthat/_snaps/breaks-log.md b/tests/testthat/_snaps/breaks-log.md new file mode 100644 index 00000000..aa7153eb --- /dev/null +++ b/tests/testthat/_snaps/breaks-log.md @@ -0,0 +1,16 @@ +# minor_breaks_log rejects invalid arguments + + Code + minor_breaks_log(7) + Condition + Error in `minor_breaks_log()`: + ! The `detail` argument must be one of 1, 5 or 10. + +--- + + Code + minor_breaks_log(smallest = 0) + Condition + Error in `minor_breaks_log()`: + ! The `smallest` argument must be a finite, positive, non-zero number. + diff --git a/tests/testthat/test-breaks-log.R b/tests/testthat/test-breaks-log.R index 045813ac..5cbecb8c 100644 --- a/tests/testthat/test-breaks-log.R +++ b/tests/testthat/test-breaks-log.R @@ -110,12 +110,6 @@ test_that("minor_breaks_log has correct amount of detail", { }) test_that("minor_breaks_log rejects invalid arguments", { - expect_error( - minor_breaks_log(7), - "must be one of 1, 5 or 10" - ) - expect_error( - minor_breaks_log(smallest = 0), - "must be a finite, positive, non-zero number." - ) + expect_snapshot(minor_breaks_log(7), error = TRUE) + expect_snapshot(minor_breaks_log(smallest = 0), error = TRUE) })