Package: mockery 0.4.4.9000

Hadley Wickham

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.

Authors:Noam Finkelstein [aut], Lukasz Bartnik [aut], Jim Hester [aut], Hadley Wickham [aut, cre]

mockery_0.4.4.9000.tar.gz
mockery_0.4.4.9000.zip(r-4.5)mockery_0.4.4.9000.zip(r-4.4)mockery_0.4.4.9000.zip(r-4.3)
mockery_0.4.4.9000.tgz(r-4.4-any)mockery_0.4.4.9000.tgz(r-4.3-any)
mockery_0.4.4.9000.tar.gz(r-4.5-noble)mockery_0.4.4.9000.tar.gz(r-4.4-noble)
mockery_0.4.4.9000.tgz(r-4.4-emscripten)mockery_0.4.4.9000.tgz(r-4.3-emscripten)
mockery.pdf |mockery.html
mockery/json (API)
NEWS

# Installmockery in R:
install.packages('mockery',repos = c('https://r-lib.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/r-lib/mockery/issues

On CRAN:

7 exports 98 stars 5.21 score 31 dependencies 4 dependents 63.4k downloads

Last updated 8 months agofrom:147de292dc

Exports:expect_argsexpect_callexpect_calledmockmock_argsmock_callsstub

Dependencies:briocallrclicrayondescdiffobjdigestevaluatefansifsgluejsonlitelifecyclemagrittrpillarpkgbuildpkgconfigpkgloadpraiseprocessxpsR6rematch2rlangrprojroottestthattibbleutf8vctrswaldowithr

Mocks: Integrating with testthat

Rendered frommocks-and-testthat.Rmdusingknitr::rmarkdownon Jun 27 2024.

Last update: 2019-09-03
Started: 2016-10-21

Readme and manuals

Help Manual

Help pageTopics
Expectation: does the given call match the expected?call-expectations expect_args expect_call expect_called
Create and query a mocked function.length.mock mock mock_args mock_calls
R package to make mocking easiermockery-package mockery
Replace a function with a stub.stub