Created
June 14, 2013 05:46
-
-
Save jjh42/5779722 to your computer and use it in GitHub Desktop.
Idea for mock syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyTest do | |
use ExUnit.Case | |
import Mock | |
test_with_mock "test_name", HTTPotion, | |
do | |
new(buck, key, value, _), do: Object[key: {buck, key}, value: value] | |
get_update_metadata(Object[indexes: indexes]), do: indexes | |
end | |
HTTPotion.get("http://example.com") | |
assert called HTTPotion.get("http://example.com") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment