mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-03 15:40:32 +00:00
expect --to-equal tests
This commit is contained in:
parent
04d61303a8
commit
4b93c37959
37
plugins/fish-spec/spec/expect.to_equal.spec.fish
Normal file
37
plugins/fish-spec/spec/expect.to_equal.spec.fish
Normal file
@ -0,0 +1,37 @@
|
||||
import plugins/fish-spec
|
||||
|
||||
function describe_to_equal -d 'expect --to-equal'
|
||||
function before_each
|
||||
set -e result
|
||||
end
|
||||
|
||||
function it_returns_0_when_compared_values_are_the_same
|
||||
set -l equal "equal"
|
||||
|
||||
echo (expect $equal --to-equal $equal; set result $status) >/dev/null
|
||||
expect $result --to-equal 0
|
||||
end
|
||||
|
||||
function it_returns_1_when_compared_values_are_different
|
||||
set -l equal "equal"
|
||||
|
||||
echo (expect $equal --to-equal 'different'; set result $status) >/dev/null
|
||||
expect $result --to-equal 1
|
||||
end
|
||||
|
||||
function it_returns_0_when_array_elements_are_in_the_same_order
|
||||
set -l array 1 2
|
||||
|
||||
echo (expect $array --to-equal 1 2; set result $status) >/dev/null
|
||||
expect $result --to-equal 0
|
||||
end
|
||||
|
||||
function it_returns_1_when_array_elements_are_in_different_order
|
||||
set -l array 1 2
|
||||
|
||||
echo (expect $array --to-equal 2 1; set result $status) >/dev/null
|
||||
expect $result --to-equal 1
|
||||
end
|
||||
end
|
||||
|
||||
spec.run $argv
|
Loading…
Reference in New Issue
Block a user