Skip to content

Commit

Permalink
Merge pull request #72 from msz/v0.4.0
Browse files Browse the repository at this point in the history
v0.4.0
  • Loading branch information
msz authored Jan 23, 2021
2 parents 3aad012 + cdb7e09 commit 0c31179
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ delete it from your list of dependencies in `mix.exs`. Then add `:hammox`:
```elixir
def deps do
[
{:hammox, "~> 0.3"}
{:hammox, "~> 0.4"}
]
end
```
Expand Down Expand Up @@ -177,7 +177,22 @@ defmodule RealDatabaseTest do
end
```

#### Why use Hammox for my application code when I have Dialyzer?
Alternatively, if you're up for trading explicitness for some macro magic,
you can use `use Hammox.Protect` to locally define protected versions of
functions you're testing, as if you `import`ed the module:

```elixir
defmodule RealDatabaseTest do
use ExUnit.Case, async: true
use Hammox.Protect, module: RealDatabase, behaviour: Database

test "get_users/0 returns list of users" do
assert {:ok, ["jim", "joe"]} == get_users()
end
end
```

## Why use Hammox for my application code when I have Dialyzer?

Dialyzer cannot detect Mox style mocks not conforming to typespec.

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Hammox.MixProject do
use Mix.Project

@version "0.3.1"
@version "0.4.0"

def project do
[
Expand Down

0 comments on commit 0c31179

Please sign in to comment.