tests/testthat/test-rail_finder.R

# load station data
finder_typo <- rail_finder(station = "Coventry")
finder_port <- rail_finder(station_code = "LHS")

test_that("correct output", {
  expect_equal(finder_typo$region, "West Midlands")
  expect_equal(finder_typo$district, "Coventry")
})

test_that("works with multiple entries", {
  expect_equal(length(rail_finder(region = "West Midlands", district = "Coventry", county = "West Midlands")$station), 3)
})

Try the carbonr package in your browser

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

carbonr documentation built on Oct. 17, 2024, 1:06 a.m.