mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-03 15:40:32 +00:00
fail tests when using an invalid comparison
This commit is contained in:
parent
4b8b4b91bf
commit
9a7292ac9d
@ -78,6 +78,8 @@ function expect
|
|||||||
test "$expected" = "$actual"
|
test "$expected" = "$actual"
|
||||||
case --to-not-equal
|
case --to-not-equal
|
||||||
test "$expected" != "$actual"
|
test "$expected" != "$actual"
|
||||||
|
case \*
|
||||||
|
test true = false
|
||||||
end
|
end
|
||||||
|
|
||||||
set result $status
|
set result $status
|
||||||
|
14
plugins/fish-spec/spec/expect.spec.fish
Normal file
14
plugins/fish-spec/spec/expect.spec.fish
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import plugins/fish-spec
|
||||||
|
|
||||||
|
function describe_expect
|
||||||
|
function before_each
|
||||||
|
set -e result
|
||||||
|
end
|
||||||
|
|
||||||
|
function it_is_false_when_comparison_does_not_exist
|
||||||
|
echo (expect true --invalid-comparison; set result $status) >/dev/null
|
||||||
|
expect $result --to-equal 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
spec.run $argv
|
@ -16,13 +16,13 @@ function describe_oh_my_fish
|
|||||||
function it_has_a_default_custom_directory
|
function it_has_a_default_custom_directory
|
||||||
set -e fish_custom
|
set -e fish_custom
|
||||||
load_oh_my_fish
|
load_oh_my_fish
|
||||||
expect $fish_custom --to-eq "$HOME/.oh-my-fish/custom"
|
expect $fish_custom --to-equal "$HOME/.oh-my-fish/custom"
|
||||||
end
|
end
|
||||||
|
|
||||||
function it_allows_the_custom_folder_location_to_be_customized
|
function it_allows_the_custom_folder_location_to_be_customized
|
||||||
set -g fish_custom /tmp
|
set -g fish_custom /tmp
|
||||||
load_oh_my_fish
|
load_oh_my_fish
|
||||||
expect $fish_custom --to-eq '/tmp'
|
expect $fish_custom --to-equal '/tmp'
|
||||||
end
|
end
|
||||||
|
|
||||||
function it_loads_all_custom_files
|
function it_loads_all_custom_files
|
||||||
@ -30,7 +30,7 @@ function describe_oh_my_fish
|
|||||||
echo 'set -gx TEST_LOAD_CUSTOM_FILE file_loaded' > $fish_custom/test.load
|
echo 'set -gx TEST_LOAD_CUSTOM_FILE file_loaded' > $fish_custom/test.load
|
||||||
|
|
||||||
load_oh_my_fish
|
load_oh_my_fish
|
||||||
expect $TEST_LOAD_CUSTOM_FILE --to-eq 'file_loaded'
|
expect $TEST_LOAD_CUSTOM_FILE --to-equal 'file_loaded'
|
||||||
end
|
end
|
||||||
|
|
||||||
function it_loads_all_oh_my_fish_functions
|
function it_loads_all_oh_my_fish_functions
|
||||||
|
Loading…
Reference in New Issue
Block a user