tests/testthat/test_rcatfish_updates.R

#Test that rcatfish_updates returns proper information


test_that("Test that rcatfish_updates returns proper definitions",{
  updates.hit <-try(rcatfish_updates())
  if ("try-error"%in%class(updates.hit)) {
    skip("could not connect to remote database")
    }else{
      expect_identical(names(updates.hit), c("UpdateDate", "Changes", "AuthorshipChanges", "SpellingChanges","AddedGenera", "AddedSpecies"))#Check names are correct
      expect_equal(grep("Updated on \\d{1,2} [a-zA-Z]+[[:space:]]\\d{4}", updates.hit$UpdateDate), 1)#Check it say update and has month and year
    }
  }
)

Try the rcatfish package in your browser

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

rcatfish documentation built on Feb. 3, 2026, 5:07 p.m.