mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-09 13:10:40 +00:00
3021402525
+ Add fish eval fix See #fish-shell/pull/1892 + New and improved output system with colors, etc. + Support for multiple non-nested describe blocks. + Remove spec.log and favor `msg` plugin and standard echo. + `spec.eval` no longer evaluates multiple functions, acting now as a simplified router between the view `spec.view` and the controller `spec.run`. + Add new `spec.view` to act as a hub for all test output. + Add report with passed/failed tests to `spec.view` + Now test descriptions are used directly from the function name. Description fields are now optional.
30 lines
790 B
Fish
30 lines
790 B
Fish
import plugins/fish-spec
|
|
|
|
function describe_expect_to_be_false
|
|
function before_each
|
|
set -e result
|
|
end
|
|
|
|
function it_returns_1_when_evaluated_value_is_0
|
|
echo (expect true --to-be-false; set result $status) >/dev/null
|
|
expect $result --to-equal 1
|
|
end
|
|
|
|
function it_returns_0_when_evaluated_value_is_1
|
|
echo (expect false --to-be-false; set result $status) >/dev/null
|
|
expect $result --to-equal 0
|
|
end
|
|
|
|
function it_returns_1_when_evaluated_function_returns_0
|
|
echo (expect "eval true" --to-be-false; set result $status) >/dev/null
|
|
expect $result --to-equal 1
|
|
end
|
|
|
|
function it_returns_0_when_evaluated_function_returns_1
|
|
echo (expect "eval false" --to-be-false; set result $status) >/dev/null
|
|
expect $result --to-equal 0
|
|
end
|
|
end
|
|
|
|
spec.run $argv
|