Skip to content

Commit 6d82ad6

Browse files
committed
Disambiguate tests
1 parent e2da119 commit 6d82ad6

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

tests/testthat/_snaps/expect-inheritance.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@
3131
Error in `expect_s3_class()`:
3232
! `exact` must be `TRUE` or `FALSE`, not the string "yes".
3333

34-
---
35-
36-
Code
37-
expect_s4_class(factor("a"), 1)
38-
Condition
39-
Error in `expect_s4_class()`:
40-
! `class` must be a character vector or NA, not the number 1.
41-
4234
# test_s3_class respects class hierarchy
4335

4436
`x` inherits from 'a'/'b' not 'c'.
@@ -47,6 +39,14 @@
4739

4840
`x` inherits from 'a'/'b' not 'c'/'d'.
4941

42+
# expect_s4_class validates its inputs
43+
44+
Code
45+
expect_s4_class(factor("a"), 1)
46+
Condition
47+
Error in `expect_s4_class()`:
48+
! `class` must be a character vector or NA, not the number 1.
49+
5050
# expect_r6_class generates useful failures
5151

5252
`x` is not an R6 object.

tests/testthat/_snaps/skip.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818

1919
Reason: a_very_long_argument_name || a_very_long_argument_name || a_very_long_argument_name || a_very_long_argument_name || a_very_long_argument_name || a_very_long_argument_name || a_very_long_argument_name || a_very_long_argument_name || a_very_long_argument_name || a_very_long_argument_name || a_very_long_argument_name || a_very_long_argument_name || a_very_long_argument_name || a_very_long_argument_name is not TRUE
2020

21-
# skip_if_not_installed() works as expected
21+
# skip_if_not_installed() works as expected, absence and version
2222

2323
Reason: {doesntexist} is not installed
2424

2525
---
2626

2727
Reason: Installed testthat is version 3.0.0; but 9999.9999.999 is required
2828

29-
---
29+
# skip_if_not_installed() works as expected, offline
3030

3131
Reason: offline
3232

tests/testthat/test-expect-inheritance.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ test_that("expect_s4_class allows unquoting of first argument", {
8282
})
8383

8484

85-
test_that("expect_s3_class validates its inputs", {
85+
test_that("expect_s4_class validates its inputs", {
8686
expect_snapshot(error = TRUE, {
8787
expect_s4_class(factor("a"), 1)
8888
})

tests/testthat/test-skip.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ test_that("autogenerated message is always single line", {
3737

3838
# skip helpers ------------------------------------------------------------
3939

40-
test_that("skip_if_not_installed() works as expected", {
40+
test_that("skip_if_not_installed() works as expected, absence and version", {
4141
local_mocked_bindings(package_version = function(x) "3.0.0")
4242

4343
expect_snapshot_skip(skip_if_not_installed("doesntexist"))
4444
expect_snapshot_skip(skip_if_not_installed("testthat", "9999.9999.999"))
4545
expect_no_skip(skip_if_not_installed("testthat", "1.0.0"))
4646
})
4747

48-
test_that("skip_if_not_installed() works as expected", {
48+
test_that("skip_if_not_installed() works as expected, offline", {
4949
skip_if_not_installed("curl")
5050
skip_on_cran()
5151

0 commit comments

Comments
 (0)