Skip to content

Commit 6c0d554

Browse files
authored
docs(assert): document assert_not_equals in the catalog (#848)
1 parent db47208 commit 6c0d554

3 files changed

Lines changed: 37 additions & 2 deletions

File tree

‎docs/assertions.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,25 @@ function test_failure() {
11031103
```
11041104
:::
11051105

1106+
## assert_not_equals
1107+
> `assert_not_equals "expected" "actual"`
1108+
1109+
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.
1110+
1111+
- [assert_equals](#assert-equals) is the inverse of this assertion and takes the same arguments.
1112+
1113+
::: code-group
1114+
```bash [Example]
1115+
function test_success() {
1116+
assert_not_equals "foo" "bar"
1117+
}
1118+
1119+
function test_failure() {
1120+
assert_not_equals "foo" "foo"
1121+
}
1122+
```
1123+
:::
1124+
11061125
## assert_not_same
11071126
> `assert_not_same "expected" "actual"`
11081127

‎tests/acceptance/snapshots/bashunit_test_sh.test_bashunit_should_display_all_assert_docs.snapshot‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,15 @@ Reports an error if `expected` and `actual` are not equals.
431431
- assert_files_not_equals is the inverse of this assertion and takes the same arguments.
432432

433433

434+
## assert_not_equals
435+
--------------
436+
> `assert_not_equals "expected" "actual"`
437+
438+
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.
439+
440+
- assert_equals is the inverse of this assertion and takes the same arguments.
441+
442+
434443
## assert_not_same
435444
--------------
436445
> `assert_not_same "expected" "actual"`
@@ -614,5 +623,3 @@ Reports an error if `command` completes in `threshold_ms` milliseconds or less.
614623

615624
Unambiguously reports an error message. Useful for reporting specific message
616625
when testing situations not covered by any `assert_*` functions.
617-
618-

‎tests/acceptance/snapshots/bashunit_test_sh.test_bashunit_should_display_filtered_assert_docs.snapshot‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ Reports an error if `expected` and `actual` are not equals.
3333
- assert_files_not_equals is the inverse of this assertion and takes the same arguments.
3434

3535

36+
## assert_not_equals
37+
--------------
38+
> `assert_not_equals "expected" "actual"`
39+
40+
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.
41+
42+
- assert_equals is the inverse of this assertion and takes the same arguments.
43+
44+
3645
## assert_files_not_equals
3746
--------------
3847
> `assert_files_not_equals "expected" "actual"`

0 commit comments

Comments
 (0)