oh-my-fish/plugins/fish-spec/spec/expect.to_equal.spec.fish
Jorge Bucaran 3021402525 ⌁ Update Fish-Spec ⌁
+ 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.
2015-01-17 13:46:44 +09:00

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