Last active
August 24, 2016 14:35
-
-
Save Ball/71957c5ad5489a212213592031130262 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 SomeTest do | |
use ExUnit.Case | |
def some_function(%{arg1: "thing", arg3: _}) do | |
:two | |
end | |
def some_function(%{arg1: "thing", arg2: _}) do | |
:one | |
end | |
def some_function(_) do | |
:total_miss | |
end | |
test ":one was called" do | |
assert :one == some_function(%{arg1: "thing", arg2: 2}) | |
end | |
test ":two was called" do | |
# fails and returns :total_miss | |
assert :two == some_function(%{arg1: "thing", arg3: 3}) | |
end | |
end |
Thank you. That seems to work. Now to figure out why my actual code isn't behaving correctly.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You don't have a method with both
arg2
andarg3
. You havearg1
+arg2
andarg1
+arg3
.