tests/testthat/test_WTareas.R

library(testthat)
library(webTRISr)

test_that("WTares() returns dataframe", {
    x <- webtris_areas()
    expect_is(x, class = "data.frame")
    
    expected_variables <- c("Id", "Name", "Description", "XLongitude", 
        "XLatitude", "YLongitude", "YLatitude")
    
    expect_equivalent(expected_variables, colnames(x))
})


test_that("WTares(3) returns dataframe", {
    x <- webtris_areas(3)
    expect_is(x, class = "data.frame")
    
    expected_variables <- c("Id", "Name", "Description", "XLongitude", 
        "XLatitude", "YLongitude", "YLatitude")
    
    expect_equivalent(expected_variables, colnames(x))
})

Try the webTRISr package in your browser

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

webTRISr documentation built on Aug. 8, 2019, 1:03 a.m.