Skip to content
A basic mocking module
Julia
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
docs
src
test
.gitignore
.travis.yml
LICENSE
Manifest.toml
Project.toml
README.md

README.md

SimpleMock Stable Dev Build Status

A basic mocking module, inspired by Python's unittest.mock and implemented with Cassette.

using SimpleMock

f(x) = x + 1
mock(+) do plus
    @assert plus isa Mock
    @assert f(0) != 1  # The call to + is mocked.
    @assert called_once_with(p, 0, 1)
end

mock((+, Float64, Float64) => Mock((a, b) -> 2a + 2b)) do plus
    @assert 1 + 1 == 2
    @assert 2.0 + 2.0 == 8
    @assert called_once_with(plus, 2.0, 2.0)
end

See the documentation for more details and examples.

You can’t perform that action at this time.