Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pivot_longer test to nottshcData template #9

Open
Lextuga007 opened this issue May 24, 2022 · 2 comments
Open

Add pivot_longer test to nottshcData template #9

Lextuga007 opened this issue May 24, 2022 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@Lextuga007
Copy link
Member

## pivot_time_longer = TRUE ----
testthat::test_that("<table> - pivot_time_longer = TRUE", {

  col_names <- c()

  df <- get_() %>%
    tidy_(pivot_time_longer = TRUE) %>%
    head(5) %>%
    dplyr::collect()

  testthat::expect_named(
    df, col_names,
    ignore.order = TRUE, ignore.case = FALSE
  )
})
@Lextuga007 Lextuga007 added the documentation Improvements or additions to documentation label May 24, 2022
@Lextuga007 Lextuga007 self-assigned this May 24, 2022
@Lextuga007
Copy link
Member Author

And add:

##.keep_source = TRUE----
testthat::test_that("<table> - .keep_source = TRUE", {

  col_names <- c(
    'source'
  )

  df <- get_() %>%
    tidy_(pivot_time_longer = TRUE,
                      .keep_source = TRUE) %>%
    head(5) %>%
    dplyr::collect()

  testthat::expect_named(
    df, col_names,
    ignore.order = TRUE, ignore.case = FALSE
  )
})

@Lextuga007
Copy link
Member Author

dput(names(df)) to get column names in c()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant