mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-03 15:40:32 +00:00
expect --to-be-true tests
This commit is contained in:
parent
68b8546ce8
commit
cb3ce0317a
29
plugins/fish-spec/spec/expect.to_be_true.spec.fish
Normal file
29
plugins/fish-spec/spec/expect.to_be_true.spec.fish
Normal file
@ -0,0 +1,29 @@
|
||||
import plugins/fish-spec
|
||||
|
||||
function describe_to_be_true -d 'expect --to-be-true'
|
||||
function before_each
|
||||
set -e result
|
||||
end
|
||||
|
||||
function it_returns_0_when_evaluated_value_returns_0
|
||||
echo (expect true --to-be-true; set result $status) >/dev/null
|
||||
expect $result --to-equal 0
|
||||
end
|
||||
|
||||
function it_returns_1_when_evaluated_value_returns_1
|
||||
echo (expect false --to-be-true; set result $status) >/dev/null
|
||||
expect $result --to-equal 1
|
||||
end
|
||||
|
||||
function it_returns_0_when_evaluated_function_returns_0
|
||||
echo (expect "eval true" --to-be-true; set result $status) >/dev/null
|
||||
expect $result --to-equal 0
|
||||
end
|
||||
|
||||
function it_returns_1_when_evaluated_function_returns_1
|
||||
echo (expect "eval false" --to-be-true; set result $status) >/dev/null
|
||||
expect $result --to-equal 1
|
||||
end
|
||||
end
|
||||
|
||||
spec.run $argv
|
Loading…
Reference in New Issue
Block a user