Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nicer error messaged on bad mock form #69

Open
josephwilk opened this issue Aug 15, 2013 · 0 comments
Open

nicer error messaged on bad mock form #69

josephwilk opened this issue Aug 15, 2013 · 0 comments
Milestone

Comments

@josephwilk
Copy link
Owner

Code (Notice I missed the comma between name and mock... pesky Clojure)

fact "less_than_or_equal? with a dev elixir version" [System.version |> "0.10.2-dev"] do
end

Error

** (Protocol.UndefinedError) protocol Binary.Chars not implemented for {{:., [line: 15], [Kernel, :access]}, [line: 15], ["less_than_or_equal? with a dev elixir version", {:|>, [line: 15], [{{:., [line: 15], [{:__aliases__, [line: 15], [:System]}, :version]}, [line: 15], []}, "0.10.2-dev"]}]}
    /Users/josephwilk/Workspace/josephwilk/elixir/amrita/lib/amrita.ex:106: Amrita.Facts.fact_name/1
    /Users/josephwilk/Workspace/josephwilk/elixir/amrita/lib/amrita.ex:145: Amrita.Facts."MACRO-fact"/5
    /Users/josephwilk/Workspace/josephwilk/elixir/amrita/test/unit/amrita/elixir/t_version.exs:15: Amrita.Facts.fact/2

And again I messed up the form (missed out keyword provided), should be a nicer error if possible:

Code

fact "less_than_or_equal? with a dev elixir version", [System.version |> "0.10.2-dev"] do                 |
    Version.less_than_or_equal?([0,10,1]) |> truthy                                                                   |
  end

Error

** (ArgumentError) unsupported expression in pipeline |> operator: "0.10.2-dev"
    /Users/josephwilk/Workspace/josephwilk/elixir/amrita/test/unit/amrita/elixir/t_version.exs:15: Kernel.|>/2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant