Skip to content

Commit

Permalink
Improve docs for assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
José Valim committed Apr 25, 2012
1 parent 1c64f1c commit d515e0a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/ex_unit/assertions.ex
@@ -1,6 +1,25 @@
defexception ExUnit.AssertionError, message: "assertion failed"

defmodule ExUnit.Assertions do
@moduledoc """
This module contains a set of assertions functions that are
imported by default into your test cases.
In general, a developer will want to use the general
`assert` macro in tests. The macro tries to be smart
and provide good reporting whenever there is a failure.
For example, `assert some_fun() == 10` will fail (assuming
`some_fun()` returns 13):
Expected 10 to be equal to 13
This module also provides other small convenient functions
like `assert_match`, `assert_member` and `assert_raise` to
easily handle other common cases as, respectively, asserting
if two terms match, asserting if an item belongs to a list or
if a function raises an exception.
"""

@doc """
Asserts the `expected` value is true.
Expand Down

0 comments on commit d515e0a

Please sign in to comment.