tests/testthat/test-typicalVolume.R

test_that("Getting all values", {
  t <- typicalVolume()
  expect_equal(typeof(t), "list")
  expect_equal(ncol(t), 2)
  expect_equal(names(t), c("thing", "dBA"))
})

test_that("Getting specific values", {
  expect_error(typicalVolume("horseradish"), "Thing not found.")
  expect_equal(typicalVolume("steam engine"), 85)
})

Try the sonicscrewdriver package in your browser

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

sonicscrewdriver documentation built on May 29, 2024, 3:39 a.m.