Skip to content

Commit 7ce7afd

Browse files
committed
Usefull diff output and simpler implementation
1 parent 6965c71 commit 7ce7afd

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

README.adoc

+6-3
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ Asserts that the content of the file _actual_ does not have any differences to t
481481

482482
```test
483483
test_obvious_notmatching_with_assert_no_diff(){
484-
assert_no_diff bash_unit README.adoc "content of 'README.adoc' should be the same as 'bash_unit'"
484+
assert_no_diff <(echo foo) <(echo bar)
485485
}
486486
test_obvious_matching_with_assert_assert_no_diff(){
487487
assert_no_diff bash_unit bash_unit
@@ -492,8 +492,11 @@ test_obvious_matching_with_assert_assert_no_diff(){
492492
```output
493493
Running test_obvious_matching_with_assert_assert_no_diff ... SUCCESS
494494
Running test_obvious_notmatching_with_assert_no_diff ... FAILURE
495-
content of 'README.adoc' should be the same as 'bash_unit'
496-
expected 'README.adoc' to be identical to 'bash_unit' but was different
495+
expected 'doc' to be identical to 'doc' but was different
496+
out> 1c1
497+
out> < foo
498+
out> ---
499+
out> > bar
497500
doc:2:test_obvious_notmatching_with_assert_no_diff()
498501
```
499502

bash_unit

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ assert_no_diff() {
149149
local message=${3:-}
150150
[[ -z $message ]] || message="$message\n"
151151

152-
diff -u "${expected}" "${actual}" >/dev/null || \
153-
fail "$message expected '${actual}' to be identical to '${expected}' but was different"
152+
assert 'diff '"${expected}"' '"${actual}" \
153+
"$message expected '"${actual}"' to be identical to '"${expected}"' but was different"
154154
}
155155

156156
fake() {

0 commit comments

Comments
 (0)