hadley/testthat — pull request #77 by jknowles (2013-05-23 15:32:45+00:00)
Title: Additional expectations

I think it would be more convenient if three additional expectations were available for numeric values, chiefly: `is_less_than` `is_more_than` and `unequal`. I have coded these up and written test for them to ensure they work.

I know this functionality is available by having the user write something like:

```
result <- foo(param1)
test1 <- result > expectation

test_that("Values are sensible", {
expect_true(test1)
})
```

But to me this is unsatisfying and it would be preferable for the user to do the following:

```
test_that("Values are sensible", {
expect_more_than(foo(param1), 100)
expect_less_than(foo(param1), 200)
expect_unequal(foo(param1), 159)
})
```

This makes testing even simpler and more straightforward as it allows tests to be written with floor and ceiling values, which are often easier to think of than exact equalities in R.

But, I understand this might be considered cluttering up the code base unnecessarily. I use these functions in my own local `testthat`, but thought I would send them upstream and see if they are worth inclusion in the package.