mockery: Mocking Library for R

The two main functionalities of this package are creating mock objects (functions) and selectively intercepting calls to a given function that originate in some other function. It can be used with any testing framework available for R. Mock objects can be injected with either this package's own stub() function or a similar with_mock() facility present in the testthat package.

Author
Noam Finkelstein [aut, cre], Lukasz Bartnik [aut]
Date of publication
2016-10-25 10:30:48
Maintainer
Noam Finkelstein <noam.finkelstein@jhu.edu>
License
MIT + file LICENSE
Version
0.2.0
URLs

View on CRAN

Man pages

call-expectations
Expectation: does the given call match the expected?
expect_called
Add expectation to a function.
get_function_source
Returns the pure R source code for a given function.
mock
Create and query a mocked function.
mockery
R package to make mocking easier
stub
Replace a function with a stub.

Files in this package

mockery
mockery/inst
mockery/inst/doc
mockery/inst/doc/mocks-and-testthat.R
mockery/inst/doc/mocks-and-testthat.html
mockery/inst/doc/mocks-and-testthat.Rmd
mockery/tests
mockery/tests/testthat.R
mockery/tests/testthat
mockery/tests/testthat/test_stub.R
mockery/tests/testthat/test-mock-object.R
mockery/tests/testthat/test_function_source_utils.R
mockery/tests/testthat/test_expect_called.R
mockery/NAMESPACE
mockery/R
mockery/R/function_source_utils.R
mockery/R/mockery.R
mockery/R/mock-object.R
mockery/R/expect_called.R
mockery/R/expectations.R
mockery/R/stub.R
mockery/vignettes
mockery/vignettes/mocks-and-testthat.Rmd
mockery/README.md
mockery/MD5
mockery/build
mockery/build/vignette.rds
mockery/DESCRIPTION
mockery/man
mockery/man/mock.Rd
mockery/man/stub.Rd
mockery/man/call-expectations.Rd
mockery/man/get_function_source.Rd
mockery/man/mockery.Rd
mockery/man/expect_called.Rd
mockery/LICENSE