-
Notifications
You must be signed in to change notification settings - Fork 70
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
Shellspec Reporting Failure when all test passed- script uses dynamic parameter as input #259
Comments
I know it says " -59 examples did not run (unexpected exit?)" but they did run and the JUNIT report produced is correct. |
Solved this. Seems like only for loops are supported. Was a bit frustrating. Has to change the IFS setting to get it to split with cat on the newline character.
|
Here is another example that could reproduce the error "expected 0 examples, but only ran XXX examples", #!/bin/bash
Describe 'hello'
seq_limit=3
Parameters:dynamic
for key in $(seq 0 $seq_limit); do
%data $key
done
End
hello() {
echo -n $1
}
It 'should return the same thing as input'
When call hello $1
The output should equal $1
End
End $ shellspec spec/hello_spec.sh
~/.local/lib/shellspec/lib/libexec/translator.sh: line 428: seq_limit: unbound variable
Unexpected error occurred (syntax error?)
Running: /bin/sh [bash 5.2.15(1)-release]
....
Finished in 0.25 seconds (user 0.18 seconds, sys 0.05 seconds)
4 examples, 0 failures, -4 examples did not run (unexpected exit?)
Failure examples / Errors: (Listed here affect your suite's status)
shellspec spec/hello_spec.sh # expected 0 examples, but only ran 4 examples
Aborted with status code [executor: 0] [reporter: 101] [error handler: 102]
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The script is reading in a text file as a dynamic parameter:
This is the output from Execution. All 59 tests passed but it's reporting a fail
The text was updated successfully, but these errors were encountered: