Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a single context type #12

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SimpleMock"
uuid = "a896ed2c-15a5-4479-b61d-a0e88e2a1d25"
authors = ["Chris de Graaf <[email protected]>"]
version = "1.1.4"
authors = ["Chris de Graaf <[email protected]>"]
version = "2.0.0"

[deps]
Cassette = "7057c7e9-c182-5462-911a-8362d720325c"
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ mock(+) do plus
@assert called_once_with(plus, 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)
mock((+) => Mock((a, b) -> 2a + 2b) do plus
@assert 1 + 1 == 4
@assert called_once_with(plus, 1, 1)
end
```

Expand Down
13 changes: 0 additions & 13 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,6 @@ reset!
mock
```

## Filter Functions

```@docs
max_depth
min_depth
excluding
including
Metadata
current_depth
current_function
current_module
```

## Index

```@index
Expand Down
14 changes: 4 additions & 10 deletions src/SimpleMock.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ and implemented with
"""
module SimpleMock

using Base: Callable, invokelatest, unwrap_unionall
using Base: Callable, invokelatest, kwarg_decl
using Base.Iterators: Pairs
using Core: Builtin, kwftype
using Core: kwftype

using Cassette: Cassette, Context, overdub, posthook, prehook, recurse, @context
using Cassette: Cassette, overdub, @context

export
Call,
Expand All @@ -26,14 +26,8 @@ export
called_once_with,
has_call,
has_calls,
reset!,
max_depth,
min_depth,
excluding,
including
reset!

include("metadata.jl")
include("filters.jl")
include("mock_type.jl")
include("mock_fun.jl")

Expand Down
27 changes: 0 additions & 27 deletions src/filters.jl

This file was deleted.

104 changes: 0 additions & 104 deletions src/metadata.jl

This file was deleted.

Loading