-
Notifications
You must be signed in to change notification settings - Fork 332
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior
Description
Hoping this is reproducible:
- Created a new R package (via new project) using RStudio.
usethis::use_testthat()
usethis::use_test("example")
- Modify
test-example.R
to
library(dplyr)
context("test-example.R")
test_that("multiplication works", {
expect_equal(2 * 2, 4)
})
devtools::test()
gives
> devtools::test()
Loading tmp2
Testing tmp2
√ | OK F W S | Context
Error in x[[method]](...) : attempt to apply non-function
== Results =====================================================================
Duration: 0.2 s
OK: 0
Failed: 2
Warnings: 1
Skipped: 0
but if the context
comes before library
in test-example.R
, everything works. Is this expected? I'm using testthat 2.0.0
.
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior