tests/testthat/test_read_excel.R

context("read_excel")

iris$Species <- as.character(iris$Species)

test_that("read_excel reads_list and combines", {
  expect_equal(read_excel(list(system.file("extdata/datasets.xlsx", package = "readxl"),
                               system.file("extdata/datasets.xlsx", package = "readxl")),
                          combine = TRUE), rbind(iris, iris))
})

test_that("read_excel reads_list and combines", {
  expect_equal(read_excel(list(system.file("extdata/datasets.xlsx", package = "readxl"),
                               system.file("extdata/datasets.xlsx", package = "readxl")),
                          combine = FALSE), list(tibble::as_data_frame(iris), tibble::as_data_frame(iris)))
})

test_that("read_excel default", {
  expect_equal(read_excel(system.file("extdata/datasets.xlsx", package = "readxl")),
               tibble::as_data_frame(iris))
})
BenBarnard/GradSchoolReport documentation built on Dec. 31, 2017, 12:11 p.m.