Open sputtene opened 7 years ago
I just found that if I change the load
statements to run
in the bats file, Everything works as expected:
$ bats --tap t/
1..2
ok 1 Loading the script must succeed
not ok 2 ... and not return any output
# (in test file t/00_smoke.bats, line 10)
# `[ -z "$output" ]' failed
I'm still wondering about the integer expression expected
error though.
I know this is an old thread, but I just had the same issue.
The message [: : integer expression expected
comes from this expression in bash: [ "" -eq 0 ]
It means that $status
is unset because you have to use run
not load
.
So, this issue can be safely closed. :wink:
Hi,
I'm trying to test a script that reads from STDIN.
I'm refactoring the script for easy testability (extracting logic to functions, implementing the modulino paradigm, so the script can be either sourced from another script or run directly from the command line), but I'm not there yet.
When I run my script through the test, I get this output:
The
TMP_DIR: /tmp/foobar.vQeXgFe3/
is output from my script, so that's expected.I was wondering about 2 things:
/tmp/bats.8003.src: line 5: [: : integer expression expected
error about? The file/tmp/bats.8003.src
doesn't exist anymore, so I can't inspect it.File
t/00_smoke.bats
: