Skip to content

Instantly share code, notes, and snippets.

@jjh42
Created June 14, 2013 05:46
Show Gist options
  • Save jjh42/5779722 to your computer and use it in GitHub Desktop.
Save jjh42/5779722 to your computer and use it in GitHub Desktop.
Idea for mock syntax
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