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.
38 lines
916 B
Fish
38 lines
916 B
Fish
import plugins/fish-spec
|
|
|
|
function describe_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_list_items_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_list_items_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
|