diff --git a/docs/assertions.md b/docs/assertions.md index 592d0358..661ddcb3 100644 --- a/docs/assertions.md +++ b/docs/assertions.md @@ -1103,6 +1103,25 @@ function test_failure() { ``` ::: +## assert_not_equals +> `assert_not_equals "expected" "actual"` + +Reports an error if the two variables `expected` and `actual` are equal ignoring the special chars like ANSI Escape Sequences (colors) and other special chars like tabs and new lines. + +- [assert_equals](#assert-equals) is the inverse of this assertion and takes the same arguments. + +::: code-group +```bash [Example] +function test_success() { + assert_not_equals "foo" "bar" +} + +function test_failure() { + assert_not_equals "foo" "foo" +} +``` +::: + ## assert_not_same > `assert_not_same "expected" "actual"` diff --git a/tests/acceptance/snapshots/bashunit_test_sh.test_bashunit_should_display_all_assert_docs.snapshot b/tests/acceptance/snapshots/bashunit_test_sh.test_bashunit_should_display_all_assert_docs.snapshot index aaf7b4a3..97fefb84 100644 --- a/tests/acceptance/snapshots/bashunit_test_sh.test_bashunit_should_display_all_assert_docs.snapshot +++ b/tests/acceptance/snapshots/bashunit_test_sh.test_bashunit_should_display_all_assert_docs.snapshot @@ -431,6 +431,15 @@ Reports an error if `expected` and `actual` are not equals. - assert_files_not_equals is the inverse of this assertion and takes the same arguments. +## assert_not_equals +-------------- +> `assert_not_equals "expected" "actual"` + +Reports an error if the two variables `expected` and `actual` are equal ignoring the special chars like ANSI Escape Sequences (colors) and other special chars like tabs and new lines. + +- assert_equals is the inverse of this assertion and takes the same arguments. + + ## assert_not_same -------------- > `assert_not_same "expected" "actual"` @@ -614,5 +623,3 @@ Reports an error if `command` completes in `threshold_ms` milliseconds or less. Unambiguously reports an error message. Useful for reporting specific message when testing situations not covered by any `assert_*` functions. - - diff --git a/tests/acceptance/snapshots/bashunit_test_sh.test_bashunit_should_display_filtered_assert_docs.snapshot b/tests/acceptance/snapshots/bashunit_test_sh.test_bashunit_should_display_filtered_assert_docs.snapshot index b3e12a41..957e0848 100644 --- a/tests/acceptance/snapshots/bashunit_test_sh.test_bashunit_should_display_filtered_assert_docs.snapshot +++ b/tests/acceptance/snapshots/bashunit_test_sh.test_bashunit_should_display_filtered_assert_docs.snapshot @@ -33,6 +33,15 @@ Reports an error if `expected` and `actual` are not equals. - assert_files_not_equals is the inverse of this assertion and takes the same arguments. +## assert_not_equals +-------------- +> `assert_not_equals "expected" "actual"` + +Reports an error if the two variables `expected` and `actual` are equal ignoring the special chars like ANSI Escape Sequences (colors) and other special chars like tabs and new lines. + +- assert_equals is the inverse of this assertion and takes the same arguments. + + ## assert_files_not_equals -------------- > `assert_files_not_equals "expected" "actual"`