tests/testthat/test-block_comment.R

context("block_comment")


test_that("Correct output", {
  expect_that(block_comment("hejsan!", width = 20), prints_text("####################"))
  expect_that(block_comment("hejsan!", width = 20), prints_text("#                  #"))
  expect_that(block_comment("hejsan!", width = 20), prints_text("#     hejsan!      #"))
  expect_that(block_comment("hejsan!", html = TRUE), prints_text("<!--"))
  expect_that(block_comment("hejsan!", token = "3"), prints_text("333"))  
  expect_that(block_comment("hejsan!", allign = "left", width = 30), prints_text("# hejsan!                    #"))  
})

Try the commentr package in your browser

Any scripts or data that you put into this service are public.

commentr documentation built on May 2, 2019, 2:23 a.m.