josephwilk / amrita

A polite, well mannered and thoroughly upstanding testing framework for Elixir
201 stars 28 forks source link

Elixir complex data types as arguments in mocks #35

Closed josephwilk closed 11 years ago

josephwilk commented 11 years ago

Currently since meck is being used for mocking it messes up anything that expands into a tuple in Elixir (such as a regex). Since Erlang does not know what that is.

  fact "mock with an elixir argument" do
    provided [MocksTest.Funk.hip?(%r"monkey") |> false] do
      Funk.hip?(%r"monkey") |> falsey
    end
  end

And the result:

"MocksTest.Funk.hip?({%r\"monkey\",[]}) called 0 times." |> called("Expected atleast once")

Suspect this is leading towards doing the argument matching ourselves from the history rather than let meck handle it.

Types:

josephwilk commented 11 years ago

Closes: https://github.com/josephwilk/amrita/commit/cabbf018c7360f9dc56d3952c798e270677a327b