# context("Test segment wrapper")
#
#
# test_format <- function(res){
# expect_true(all(c(".id", "segment") %in% names(res)))
# }
#
# test_that("unique_segment works", {
# actual_res <- wrap_unique_segment(5)
#
# test_format(actual_res)
# expect_equal(actual_res$.id, 1:5 )
# expect_equal(dplyr::n_distinct(levels(actual_res$segment)), 1)
#
# })
#
#
# test_frame <- mtcars %>% dplyr::mutate(carb = factor(carb))
# test_that("segmentation by name works", {
#
# actual_res <- wrap_segment_by_name(
# test_frame = test_frame,
# segment_name = "carb"
# )
#
# test_format(actual_res)
# expect_equal(actual_res$.id, 1:32)
# expect_equal(dplyr::n_distinct(levels(actual_res$segment)), 6)
# })
#
#
#
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.