tests/testthat/test-02-make_example.R

context("02-make_example()")


test_that(
  "make_example returns list of examples when called without argument, i,.e. here empty",
  {
    expect_message(
      object = make_example(),
      file = "Included examples are:",
    )
  }
)

test_that(
  "make_example() raises error when called with non-existing name",
  {
    expect_error(
      object = make_example(name = "DOES_NOT+EXIST"),
      regexp = "Invalid example. 'name' has to be one of the following values:"
    )
  }
)

# setwd(tempdir())
# test_that(
#   "Does the copying without errors",
#   {
#     expect_null(
#       object = make_example("basic")
#     )
#   }
# )

Try the dmdScheme package in your browser

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

dmdScheme documentation built on Aug. 22, 2022, 9:06 a.m.