-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsupported -a in fishtape 2.0.0 #40
Comments
@matchai Funny story. Fishtape 1 didn't have this either. Your tests will pass even if the next condition fails. |
@jorgebucaran Oh... That's a shock. 😳 |
@matchai What happens if the expression fails—how do we report that with TAP? Here is an alternative. Print the @test "It should not mock blacklisted elements" (
echo (
mock eval \*
echo $status
)
) = "The function \"eval\" is reserved and therefore cannot be mocked. 0" We need to wrap Here is another idea: If you check the exit status often, create a utility function to echo stdout if function only_if_ok
and echo "$argv"; or echo
end
@test "It should not mock blacklisted elements" (
only_if_ok (mock eval \*)
) = "The function \"eval\" is reserved and therefore cannot be mocked." |
I think the ideal thing would be to support subtests. Though they have never been standardized in TAP, they're commonly used. (TestAnything/Specification#2) Both solid suggestions! I'll try them out. 👍 |
@matchai I disagree. I'm not opposed to subtests (see below), but I am positive that using conditional operators ( Now, how do we describe subtests using our limited syntax (jorgebucaran/fishtape#34)? Here's an idea that doesn't rely on syntax:
parent_test.fish@mesg "Parent"
fishtape child_test.fish child_test.fish@mesg "Child"
fishtape granchild_test.fish grandchild_test.fish@mesg "Grandchild"
test "some foo test" foo = foo
test "some bar test" bar = bar
test "some baz test" bar = baz Closing as I won't be implementing conditional operators at this time, but we can discuss subtests in a separate issue. |
Oh yeah, absolutely. I was just thinking that having multiple test cases share the same setup would be best done with subtests. If it would be possible for tests to inherit their parents' setup, that would make |
@matchai Ah, I see what you mean then. Glad we're clear about that. |
Great work with the release of fishtape 2.0.0!
Unfortunately, the new test system doesn't allow for multiple assertions in one test, so the test setup would have to be duplicated for every test case.
E.g:
instead of:
In this example, the test setup is short, but a fair bit of duplication would need to be added tests where setup is more complex, without a way to have multiple assertions.
The text was updated successfully, but these errors were encountered: