Skip to content

trouble using test_path() with expect_equal_to_reference() #448

@jennybc

Description

@jennybc

Seems like this should work. But test_path() doesn't want to make a path that doesn't (yet) exist.

library(testthat)
dir(test_path(), pattern = "\\.rds")
#> character(0)
expect_equal_to_reference(1, "tests/testthat/one.rds")
dir(test_path(), pattern = "\\.rds")
#> [1] "one.rds"
file.remove(test_path("one.rds"))
#> [1] TRUE
dir(test_path(), pattern = "\\.rds")
#> character(0)
expect_equal_to_reference(1, test_path("one.rds"))
#> Error: `tests/testthat/one.rds` doesn't exist

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions