File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -89,27 +89,29 @@ function test_assert_match_snapshot_with_placeholder() {
8989 if check_os::is_alpine; then
9090 skip " not supported on alpine" && return
9191 fi
92- local snapshot_path
93- snapshot_path=tests/unit/snapshots/assert_snapshot_test_sh.test_assert_match_snapshot_with_placeholder.snapshot
94- mkdir -p tests/unit/snapshots
92+
93+ local temp_dir
94+ temp_dir=$( mktemp -d)
95+ local snapshot_path=" $temp_dir /assert_snapshot_test_sh.test_assert_match_snapshot_with_placeholder.snapshot"
9596 echo ' Run at ::ignore::' > " $snapshot_path "
9697
97- assert_empty " $( assert_match_snapshot " Run at $( date) " ) "
98+ assert_empty " $( assert_match_snapshot " Run at $( date) " " $snapshot_path " ) "
9899
99- rm " $snapshot_path "
100+ rm -rf " $temp_dir "
100101}
101102
102103function test_assert_match_snapshot_with_custom_placeholder() {
103104 if check_os::is_alpine; then
104105 skip " not supported on alpine" && return
105106 fi
106- local snapshot_path
107- snapshot_path=tests/unit/snapshots/assert_snapshot_test_sh.test_assert_match_snapshot_with_custom_placeholder.snapshot
108- mkdir -p tests/unit/snapshots
107+
108+ local temp_dir
109+ temp_dir=$( mktemp -d)
110+ local snapshot_path=" $temp_dir /assert_snapshot_test_sh.test_assert_match_snapshot_with_custom_placeholder.snapshot"
109111 echo ' Value __ANY__' > " $snapshot_path "
110112
111113 export BASHUNIT_SNAPSHOT_PLACEHOLDER=' __ANY__'
112- assert_empty " $( assert_match_snapshot " Value 42" ) "
114+ assert_empty " $( assert_match_snapshot " Value 42" " $snapshot_path " ) "
113115
114- rm " $snapshot_path "
116+ rm -rf " $temp_dir "
115117}
You can’t perform that action at this time.
0 commit comments