Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/ex_unit/lib/ex_unit/assertions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -670,11 +670,14 @@ defmodule ExUnit.Assertions do
@doc """
Asserts that `value1` and `value2` differ by no more than `delta`.

This difference is inclusive, so the test will pass if the difference
and the `delta` are equal.

## Examples

assert_in_delta 1.1, 1.5, 0.2
assert_in_delta 10, 15, 4
assert_in_delta 10, 15, 2
assert_in_delta 10, 15, 5

"""
def assert_in_delta(value1, value2, delta, message \\ nil)
Expand Down Expand Up @@ -840,6 +843,9 @@ defmodule ExUnit.Assertions do
@doc """
Asserts `value1` and `value2` are not within `delta`.

This difference is exclusive, so the test will fail if the difference
and the delta are equal.

If you supply `message`, information about the values will
automatically be appended to it.

Expand Down