oh-my-fish/plugins/fish-spec/spec/expect.to_be_true.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

30 lines
795 B
Fish

import plugins/fish-spec
function describe_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