Skip to content

Commit

Permalink
hotfix - closes #166
Browse files Browse the repository at this point in the history
  • Loading branch information
geneorama committed Apr 15, 2019
1 parent 5b1baac commit 464c009
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions tests/testthat/test-all.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ context("posixify function")
test_that("read Socrata CSV is compatible with posixify", {
df <- read.socrata('http://soda.demo.socrata.com/resource/4334-bgaj.csv')
dt <- posixify("09/14/2012 10:38:01 PM")
expect_equal(dt, df$Datetime[1]) ## Check that download matches test
expect_equal(dt, df$datetime[1]) ## Check that download matches test
})

test_that("read Socrata JSON is compatible with posixify (issue 85)", {
Expand Down Expand Up @@ -111,8 +111,8 @@ test_that("read Socrata CSV as default", {
expect_equal("data.frame", class(df), label="class")
expect_equal(1007, nrow(df), label="rows")
expect_equal(9, ncol(df), label="columns")
expect_equal(c("character", "character", "character", "POSIXct", "numeric",
"numeric", "integer", "character", "character"),
expect_equal(c("POSIXct", "numeric", "character", "character", "numeric",
"integer", "character", "character", "character"),
unname(sapply(sapply(df, class),`[`, 1)),
label="testing column CSV classes with defaults")
})
Expand Down Expand Up @@ -145,8 +145,8 @@ test_that("read Socrata CSV as character", {
expect_equal("data.frame", class(df), label="class")
expect_equal(1007, nrow(df), label="rows")
expect_equal(9, ncol(df), label="columns")
expect_equal(c("character", "character", "character", "POSIXct", "numeric",
"numeric", "integer", "character", "character"),
expect_equal(c("POSIXct", "numeric", "character", "character", "numeric",
"integer", "character", "character", "character"),
unname(sapply(sapply(df, class),`[`, 1)))
})

Expand All @@ -156,8 +156,8 @@ test_that("read Socrata CSV as factor", {
expect_equal("data.frame", class(df), label="class")
expect_equal(1007, nrow(df), label="rows")
expect_equal(9, ncol(df), label="columns")
expect_equal(c("factor", "factor", "factor", "POSIXct", "numeric", "numeric",
"integer", "factor", "factor"),
expect_equal(c("POSIXct", "numeric", "factor", "factor", "numeric",
"integer", "factor", "factor", "factor"),
unname(sapply(sapply(df, class),`[`, 1)))
})

Expand All @@ -166,9 +166,9 @@ test_that("read Socrata JSON as default", {
df <- read.socrata('https://soda.demo.socrata.com/resource/4334-bgaj.json')
expect_equal("data.frame", class(df), label="class")
expect_equal(1007, nrow(df), label="rows")
expect_equal(11, ncol(df), label="columns")
expect_equal(10, ncol(df), label="columns")
expect_equal(c("POSIXct", "character", "character", "character", "character",
"character", "character", "character", "character", "character",
"character", "character", "character", "character",
"character"),
unname(sapply(sapply(df, class),`[`, 1)))
})
Expand All @@ -178,9 +178,9 @@ test_that("read Socrata JSON as character", {
stringsAsFactors = FALSE)
expect_equal("data.frame", class(df), label="class")
expect_equal(1007, nrow(df), label="rows")
expect_equal(11, ncol(df), label="columns")
expect_equal(10, ncol(df), label="columns")
expect_equal(c("POSIXct", "character", "character", "character", "character",
"character", "character", "character", "character", "character",
"character", "character", "character", "character",
"character"),
unname(sapply(sapply(df, class),`[`, 1)))
})
Expand All @@ -190,9 +190,9 @@ test_that("read Socrata JSON as factor", {
stringsAsFactors = TRUE)
expect_equal("data.frame", class(df), label="class")
expect_equal(1007, nrow(df), label="rows")
expect_equal(11, ncol(df), label="columns")
expect_equal(10, ncol(df), label="columns")
expect_equal(c("POSIXct", "factor", "factor", "factor", "factor", "factor",
"factor", "factor", "factor", "factor", "factor"),
"factor", "factor", "factor", "factor"),
unname(sapply(sapply(df, class),`[`, 1)))
})

Expand Down

0 comments on commit 464c009

Please sign in to comment.