Skip to content

Commit

Permalink
add test for unequal train/test names
Browse files Browse the repository at this point in the history
  • Loading branch information
bfgray3 committed Jan 19, 2019
1 parent ca768ae commit 918cfc5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/testthat/test-conditions.R
Expand Up @@ -11,13 +11,19 @@ test_that("conditions work correctly.", {
fixed = TRUE
)

foo <- data.frame(a = 1, b = "a")
foo <- data.frame(a = 1, b = "e")
bar <- data.frame(c = 2, d = "f")

expect_error(catto_label(foo, one_of(x1, x2)),
regexp = "'one_of(x1, x2)' is not a valid column specification for foo.",
fixed = TRUE
)

expect_error(catto_label(foo, b, test = bar),
regexp = "`train` and `test` data frames must have the same names.",
fixed = TRUE
)

expect_message(catto_mean(foo),
regexp = "`response` not supplied; using first column 'a' as the response variable.",
fixed = TRUE
Expand Down

0 comments on commit 918cfc5

Please sign in to comment.