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)
})
lilyclements/caRbon documentation built on April 17, 2025, 6:10 p.m.