README.md
# Stitch
Easy mocking for easy testing.
## Instructions
It's as simple as:
```elixir
defmodule SomeTest do
import Stitch
test "calling IO.puts" do
stitch IO, ["puts"] do
result = Mymodule.func("pandoro")
# Assume func = fn x -> IO.puts(x) end
assert called(IO.puts("pandoro"))
assert result == "puts/1"
end
end
end
```
If you need a specific value:
```elixir
test "calling IO.puts" do
stitch IO, [{"puts/1", :value}] do
result = Mymodule.func("pandoro")
assert called(IO.puts("pandoro"))
assert result == :value
end
end
```