Description Usage Arguments Functions See Also Examples
These extend the testthat::expect_is to have finer grain tests.
1 2 3 4 5 | expect_is_not(object, class, label = NULL)
expect_is_exactly(object, class, label = NULL)
expect_all_inherit(object, class, label = NULL)
|
object |
the object in question. |
class |
the expected class object is to be. |
label |
Used to customise failure messages. For expert use only. |
expect_is_not
: test that an object does not inherit from a class.
expect_is_exactly
: test that an object is exactly a specific class
and not a child class.
expect_all_inherit
: test that all elements of a list inherit a given class.
Other class:
class-tests
1 2 3 4 5 6 7 8 9 10 11 | # Test to make sure an object is not of a class.
## Not run:
# will return an error.
expect_is_not(1L, "numeric")
## End(Not run)
# but this is fine.
expect_is_not('a', "numeric")
expect_is_exactly('a', "character")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.