Execute arguments as command
Runs the arguments as a command and then stores output and exit status into special global variables.
It returns with status code 0
to help making assertions in your test case.
Usage
-0 to -255 | Expect that the command exits with the given exit status. |
! | Expect that the command exits with a non-zero exit status. |
--keep-empty-lines | Keep empty lines in ${lines[0]} . |
--separate-stderr | Store STDOUT in $output and STDERR in $stderr . Lines are stored in $lines and $stderr_lines . |
Links
Examples
- Executing a command with
run
1 2 3
@test "executing a command with run" { run -0 command -v bash }
BashSupport Pro 是一款shell 脚本集成开发环境,支持 bats-core 的 run - 立即试用!