Skip to content

Commit e30affa

Browse files
committed
fix: Refactor ranking test column checks
Replaces expect_setequal with expect_in for column checks in test-cfbd_rankings.R. Also reformats the cols vector for improved readability.
1 parent e69ae4b commit e30affa

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

tests/testthat/test-cfbd_rankings.R

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
2-
31
cols <- c(
4-
"season", "season_type", "week", "poll", "rank",
5-
"school", "conference", "first_place_votes", "points"
2+
"season",
3+
"season_type",
4+
"week",
5+
"poll",
6+
"rank",
7+
"school",
8+
"conference",
9+
"first_place_votes",
10+
"points"
611
)
712

813

@@ -21,9 +26,9 @@ test_that("CFB Poll Rankings", {
2126
filter(.data$poll == "Coaches Poll" & .data$rank == 1) %>%
2227
select("school")
2328

24-
expect_setequal(colnames(x), cols)
25-
expect_setequal(colnames(y), cols)
26-
expect_setequal(colnames(z), cols)
29+
expect_in(cols, colnames(x))
30+
expect_in(cols, colnames(y))
31+
expect_in(cols, colnames(z))
2732
expect_equal(dplyr::first(first_team_AP_13$school), "Florida State")
2833
expect_equal(dplyr::first(first_team_coaches_13$school), "Florida State")
2934
expect_s3_class(x, "data.frame")

0 commit comments

Comments
 (0)