Skip to content

Commit fae5c2d

Browse files
committed
docs: fix assert_(not_)matches, added matches_no_diff
1 parent 739bde6 commit fae5c2d

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

README.adoc

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,6 @@ doc:2:test_obvious_equality_with_assert_not_equals()
423423
Running test_obvious_inequality_with_assert_not_equals ... SUCCESS
424424
```
425425

426-
##############################
427426
=== *assert_matches*
428427

429428
assert_matches <expected-regex> <actual> [message]
@@ -472,7 +471,31 @@ doc:2:test_obvious_matching_with_assert_not_matches()
472471
Running test_obvious_notmatching_with_assert_not_matches ... SUCCESS
473472
```
474473

475-
##############################
474+
=== *assert_no_diff*
475+
476+
assert_no_diff <expected> <actual> [message]
477+
478+
Asserts that the content of the file _actual_ does not have any differences to the one _expected_.
479+
480+
```test
481+
test_obvious_notmatching_with_assert_no_diff(){
482+
assert_no_diff bash_unit README.adoc "content of 'README.adoc' should be the same as 'bash_unit'"
483+
}
484+
test_obvious_matching_with_assert_assert_no_diff(){
485+
assert_no_diff bash_unit bash_unit
486+
}
487+
488+
```
489+
490+
```output
491+
Running test_obvious_matching_with_assert_assert_no_diff ... SUCCESS
492+
Running test_obvious_notmatching_with_assert_no_diff ... FAILURE
493+
content of 'README.adoc' should be the same as 'bash_unit'
494+
expected 'README.adoc' to be identical to 'bash_unit' but was different
495+
doc:2:test_obvious_notmatching_with_assert_no_diff()
496+
```
497+
498+
476499
== *fake* function
477500

478501
fake <command> [replacement code]

0 commit comments

Comments
 (0)