1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
describe("glue_collapse_data", {
it("works with empty inputs", {
expect_equal(
glue_collapse_data(mtcars, ""),
""
)
expect_equal(
glue_collapse_data(mtcars[FALSE, ], "{hp}"),
""
)
})
it("works with non-empty inputs", {
expect_equal(
glue_collapse_data(mtcars[1, ], "{hp}"),
"110"
)
expect_equal(
glue_collapse_data(mtcars[1:2, ], "{hp}"),
"110, 110"
)
})
})
describe("stop_unless_installed", {
mockery::stub(stop_unless_installed, "requireNamespace", FALSE)
expect_error(
stop_unless_installed("foo"),
"The foo package\\(s\\) are required for this functionality"
)
})
|