Skip to content

Commit e442bc6

Browse files
devonestesJosé Valim
authored andcommitted
Add additional documentation for assert_in_delta and refute_in_delta (#7191)
1 parent 3dbefd7 commit e442bc6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/ex_unit/lib/ex_unit/assertions.ex

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,11 +670,14 @@ defmodule ExUnit.Assertions do
670670
@doc """
671671
Asserts that `value1` and `value2` differ by no more than `delta`.
672672
673+
This difference is inclusive, so the test will pass if the difference
674+
and the `delta` are equal.
673675
674676
## Examples
675677
676678
assert_in_delta 1.1, 1.5, 0.2
677-
assert_in_delta 10, 15, 4
679+
assert_in_delta 10, 15, 2
680+
assert_in_delta 10, 15, 5
678681
679682
"""
680683
def assert_in_delta(value1, value2, delta, message \\ nil)
@@ -840,6 +843,9 @@ defmodule ExUnit.Assertions do
840843
@doc """
841844
Asserts `value1` and `value2` are not within `delta`.
842845
846+
This difference is exclusive, so the test will fail if the difference
847+
and the delta are equal.
848+
843849
If you supply `message`, information about the values will
844850
automatically be appended to it.
845851

0 commit comments

Comments
 (0)