Skip to content

Commit 1745cca

Browse files
committed
fix: test without perl with mock_non_existing_fn
1 parent 4d2dc08 commit 1745cca

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tests/unit/clock_test.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ function tear_down_after_script() {
1010
export _OS=$__ORIGINAL_OS
1111
}
1212

13+
function mock_non_existing_fn() {
14+
return 127;
15+
}
16+
1317
function test_now_with_perl() {
1418
mock perl echo "1720705883457"
1519

@@ -18,22 +22,22 @@ function test_now_with_perl() {
1822

1923
function test_now_on_linux_without_perl() {
2024
export _OS="Linux"
21-
mock perl /dev/null
25+
mock perl mock_non_existing_fn
2226
mock date echo "1720705883457"
2327

2428
assert_equals "1720705883457" "$(clock::now)"
2529
}
2630
function test_now_on_windows_without_perl() {
2731
export _OS="Windows"
28-
mock perl /dev/null
32+
mock perl mock_non_existing_fn
2933
mock date echo "1720705883457"
3034

3135
assert_equals "1720705883457" "$(clock::now)"
3236
}
3337

3438
function test_now_on_osx_without_perl() {
3539
export _OS="OSX"
36-
mock perl /dev/null
40+
mock perl mock_non_existing_fn
3741

3842
assert_equals "" "$(clock::now)"
3943
}

0 commit comments

Comments
 (0)