oh-my-fish/pkg/fish-spec/spec/results_spec.fish
Bruno Pinto 8fac0ca484 Improve failure reports
Show name of the test that failed with the failure message.
2015-12-21 21:53:25 +00:00

40 lines
816 B
Fish

function describe_results
function it_succeeds_when_single_assertion_succeeds
assert 1 = 1
assert success = "$__current_spec_status"
end
function it_succeeds_when_multiple_assertion_succeeds
assert 1 = 1
assert 2 = 2
assert success = "$__current_spec_status"
end
function it_fails_when_single_assertion_fails
set -g __fish_spec_output "quiet"
assert 1 = 2
set -l spec_status $__current_spec_status
# Reset internals
set -e __current_spec_status
assert error = "$spec_status"
end
function it_fails_when_one_of_the_assertions_fails
set -g __fish_spec_output "quiet"
assert 1 = 2
assert 2 = 2
set -l spec_status $__current_spec_status
# Reset internals
set -e __current_spec_status
assert error = "$spec_status"
end
end