Skip to content

Commit

Permalink
clean up tests (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbarbone committed Dec 4, 2023
1 parent a6ecd18 commit 0efbbc5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/testthat/test-colons.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ test_that("%colons%", {
expect_identical(`%colons%`, `%:::%`)

# errors
expect_error("fuj" %:::% "not_in_fuj", class = "fuj:colonsError")
expect_error("fuj" %::% "colons_example", class = "fuj:colonsError")
expect_error("fuj" %:::% "not_in_fuj", class = "colonsError")
expect_error("fuj" %::% "colons_example", class = "colonsError")
expect_error("1" %::% "foo", class = "fuj:namespaceError")

# successes
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-namespace.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ test_that("require_namespace", {
expect_true(require_namespace("base", "methods", "stats"))

# custom error on failure
expect_error(require_namespace("1"), class = "fuj:namespaceError")
expect_error(require_namespace("1"), class = "namespaceError")

# only the first package should cause an error
expect_error(
require_namespace("base", "1foo", "2foo"),
class = "fuj:namespaceError",
class = "namespaceError",
regexp = cond_namespace("1foo")$message,
fixed = TRUE
)

# this should fail because we shouldn't see 2foo
expect_error(expect_error(
require_namespace("base", "1foo", "2foo"),
class = "fuj:namespaceError",
class = "namespaceError",
regexp = "2foo",
fixed = TRUE
))
Expand Down

0 comments on commit 0efbbc5

Please sign in to comment.