Skip to content

Commit

Permalink
fix for oldrelease
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyfischetti committed Mar 24, 2015
1 parent 98c16c6 commit 6bf3f70
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 21 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: assertr
Type: Package
Title: Assertive Programming for R Analysis Pipelines
Version: 0.4
Version: 0.4.1
Authors@R: person("Tony", "Fischetti", email="[email protected]",
role = c("aut", "cre"))
Maintainer: Tony Fischetti <[email protected]>
Expand Down
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# assertr 0.4.1

* fixed automated tests to success with R 3.0.3

# assertr 0.4

* added `insist` and `within_n_sds` functions and updated vignette and documentations
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ data errors are spotted early and can be addressed quickly.

### Installation

You can install the latest version on CRAN like this

install.packages("assertr")

or you can install the bleeding-edge development version like this:

install.packages("devtools")
devtools::install_github("tonyfischetti/assertr")

I also plan to make this package available on CRAN, too, in the
near future.

### What does it look like?
This package offers two assertion functions, `assert` and `verify`, that
are designed to be used shortly after data-loading in a dplyr/magrittr
Expand Down
11 changes: 7 additions & 4 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
There were no ERRORs, WARNINGs or NOTEs
when checked locally with --no-manual

This is my first package and this is a resubmission of this package.
I changed the title of the package to proper title case, as was requested.
Additionally, there was a NOTE that I didnt see because of NEWS.md so I
changed it to NEWS and I checked it and I got NO NOTES, ERRORS, or WARNINGS.
I got an email from [email protected] saying that assertr v0.4
(which was just accepted into CRAN a few days ago) failed with the
oldrelease (3.0.3). I was told to either fix or declare a proper version
dependency.

I fixed it, slightly incremented the version number and I am submitting it
here. This is the proper thing to do, right? Please excuse my ignorance, as
this is my first package.
4 changes: 2 additions & 2 deletions inst/doc/assertr.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<meta name="author" content="Tony Fischetti" />

<meta name="date" content="2015-03-21" />
<meta name="date" content="2015-03-23" />

<title>Assertive R Programming with assertr</title>

Expand Down Expand Up @@ -54,7 +54,7 @@
<div id="header">
<h1 class="title">Assertive R Programming with assertr</h1>
<h4 class="author"><em>Tony Fischetti</em></h4>
<h4 class="date"><em>2015-03-21</em></h4>
<h4 class="date"><em>2015-03-23</em></h4>
</div>


Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-assertions.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ test_that("assert raises error if verification fails", {

test_that("assert breaks appropriately", {
expect_error(assert(in_set(0,1), mtcars$vs),
"no applicable method for 'select_' applied to an object of class \"function\"")
"no applicable method for 'select.?' applied to an object of class \"function\"")
expect_error(assert("tree"),
"no applicable method for 'select_' applied to an object of class \"character\"")
"no applicable method for 'select.?' applied to an object of class \"character\"")
})
######################################

Expand All @@ -111,9 +111,9 @@ test_that("insist raises error if verification fails", {

test_that("insist breaks appropriately", {
expect_error(insist(within_n_sds(5), mtcars$vs),
"no applicable method for 'select_' applied to an object of class \"function\"")
"no applicable method for 'select.?' applied to an object of class \"function\"")
expect_error(insist("tree"),
"no applicable method for 'select_' applied to an object of class \"character\"")
"no applicable method for 'select.?' applied to an object of class \"character\"")
expect_error(insist(iris, within_n_sds(5), Petal.Width:Species),
"argument must be a numeric vector")
})
Expand Down
14 changes: 7 additions & 7 deletions tests/testthat/test-predicates.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ test_that("not_na errors out when appropriate", {
expect_error(not_na(c()),
"not_na must be called with single element")
expect_error(not_na(),
"argument \"x\" is missing, with no default")
".x. is missing")
})
######################################


########### within_bounds ###########
test_that("within_bounds fails appropriately", {
expect_error(within_bounds(),
"argument \"lower.bound\" is missing, with no default")
".lower.bound. is missing")
expect_error(within_bounds(1, "tree"), "bounds must be numeric")
expect_error(within_bounds(2, 1),
"lower bound must be strictly lower than upper bound")
Expand All @@ -65,7 +65,7 @@ test_that("returned predicate works appropriately", {

test_that("returned predicate fails appropriately", {
expect_error(within_bounds(0,1)(),
"argument \"x\" is missing, with no default")
".x. is missing")
expect_error(within_bounds(0,1)("tree"),
"bounds must only be checked on numerics")
expect_error(within_bounds(0,1)(c(1,2)),
Expand Down Expand Up @@ -100,12 +100,12 @@ test_that("first inner function fails appropriately", {
expect_error(within_n_sds(c(1,2)),
"'n' must be a positive number")
expect_error(within_n_sds(),
"argument \"n\" is missing, with no default")
".n. is missing")
})

test_that("second inner function fails appropriately", {
expect_error(within_n_sds(1)(),
"argument \"a.vector\" is missing, with no default")
"argument .a.vector. is missing")
expect_error(within_n_sds(1)(1),
"standard deviations of vector is NA")
expect_error(within_n_sds(1)(c("johnny", "marr")),
Expand All @@ -120,7 +120,7 @@ test_that("in_set fails appropriately", {
expect_error(in_set(),
"can not test for membership in empty set")
expect_error(in_set(,allow.na=FALSE),
"argument is missing, with no default")
"argument is missing")
})

test_that("returned predicate works appropriately", {
Expand All @@ -137,7 +137,7 @@ test_that("returned predicate works appropriately", {

test_that("returned predicate fails appropriately", {
expect_error(in_set(0,1)(),
"argument \"x\" is missing, with no default")
".x. is missing")
expect_error(in_set(0,1)(c(1,2)),
"bounds must be checked on a single element")
expect_error(in_set(0,1)(c()),
Expand Down

0 comments on commit 6bf3f70

Please sign in to comment.