tests/testthat/test-rail-stations.R

test_that("rail stations are listed for all lines", {
  skip_if_no_key()
  Sys.sleep(0.11)
  s <- rail_stations(LineCode = NULL)
  expect_length(s, 10)
  expect_equal(nrow(s), 95)
  expect_s3_class(s, "data.frame")
  expect_type(s$LineCodes, "list")
})

test_that("rail stations are listed for one line", {
  skip_if_no_key()
  Sys.sleep(0.11)
  s <- rail_stations(LineCode = "RD")
  expect_length(s, 10)
  expect_equal(nrow(s), 27)
  expect_s3_class(s, "data.frame")
  expect_type(s$LineCodes, "list")
})

Try the metro package in your browser

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

metro documentation built on Nov. 2, 2023, 6:06 p.m.