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

# Install 'mockery' 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:

11.10 score 99 stars 4 packages 368 scripts 58k downloads 7 exports 24 dependencies

Last updated 1 years agofrom:147de292dc. Checks:OK: 5 NOTE: 2. Indexed: yes.

TargetResultDate
Doc / VignettesOKOct 25 2024
R-4.5-winNOTEOct 25 2024
R-4.5-linuxNOTEOct 25 2024
R-4.4-winOKOct 25 2024
R-4.4-macOKOct 25 2024
R-4.3-winOKOct 25 2024
R-4.3-macOKOct 25 2024

Exports:expect_argsexpect_callexpect_calledmockmock_argsmock_callsstub

Dependencies:briocallrclicrayondescdiffobjdigestevaluatefsgluejsonlitelifecyclemagrittrpkgbuildpkgloadpraiseprocessxpsR6rlangrprojroottestthatwaldowithr

Mocks: Integrating with testthat

Rendered frommocks-and-testthat.Rmdusingknitr::rmarkdownon Oct 25 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