@@ -23,20 +23,11 @@ function test_creates_a_snapshot() {
2323}
2424
2525function test_unsuccessful_assert_match_snapshot() {
26- local expected
27-
28- if dependencies::has_git; then
29- expected=" $( printf " ✗ Failed: Unsuccessful assert match snapshot
30- Expected to match the snapshot
31- [-Actual-]{+Expected+} snapshot[-text-]" ) "
32- else
33- expected=" $( printf " ✗ Failed: Unsuccessful assert match snapshot
34- Expected to match the snapshot" ) "
35- fi
36-
37- local actual=" $( assert_match_snapshot " Expected snapshot" ) "
26+ local actual
27+ actual=" $( assert_match_snapshot " Expected snapshot" ) "
3828
39- assert_equals " $expected " " $actual "
29+ assert_matches " Unsuccessful assert match snapshot" " $actual "
30+ assert_matches " Expected to match the snapshot" " $actual "
4031}
4132
4233function test_successful_assert_match_snapshot_ignore_colors() {
@@ -58,21 +49,12 @@ function test_creates_a_snapshot_ignore_colors() {
5849}
5950
6051function test_unsuccessful_assert_match_snapshot_ignore_colors() {
61- local expected
62-
63- if dependencies::has_git; then
64- expected=" $( printf " ✗ Failed: Unsuccessful assert match snapshot ignore colors
65- Expected to match the snapshot
66- [-Actual-]{+Expected+} snapshot[-text-]" ) "
67- else
68- expected=" $( printf " ✗ Failed: Unsuccessful assert match snapshot ignore colors
69- Expected to match the snapshot" ) "
70- fi
71-
72- local colored=$( printf ' \e[31mExpected snapshot\e[0m' )
73- local actual=" $( assert_match_snapshot_ignore_colors " $colored " ) "
52+ local colored actual
53+ colored=$( printf ' \e[31mExpected snapshot\e[0m' )
54+ actual=" $( assert_match_snapshot_ignore_colors " $colored " ) "
7455
75- assert_equals " $expected " " $actual "
56+ assert_matches " Unsuccessful assert match snapshot ignore colors" " $actual "
57+ assert_matches " Expected to match the snapshot" " $actual "
7658}
7759
7860function test_assert_match_snapshot_with_placeholder() {
0 commit comments