Skip to content

bats/helpers: Add run convenience functions #196

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

Merged
merged 1 commit into from
Sep 1, 2017
Merged

Conversation

mbland
Copy link
Owner

@mbland mbland commented Sep 1, 2017

Also adds restore_programs_in_path, which allows a single call to remove multiple command stub scripts.

run_test_script creates and runs a test script in one step, so that create_bats_test_script and run need not be called separately.

run_bats_test_suite is a specialized version of run_test_script specifically for generating and running Bats test cases.

run_bats_test_suite_in_isolation is an even more specialized version of run_bats_test_suite to ensure that PATH is restricted to BATS_TEST_BINDIR and the Bats libexec/ directory within the suite. Along with stub_program_in_path and create_forwarding_script, this is useful for testing helper functions whose behavior depends on the available system commands, such as skip_if_... helpers.

Also adds `restore_programs_in_path`, which allows a single call to
remove multiple command stub scripts.

`run_test_script` creates and runs a test script in one step, so that
`create_bats_test_script` and `run` need not be called separately.

`run_bats_test_suite` is a specialized version of `run_test_script`
specifically for generating and running Bats test cases.

`run_bats_test_suite_in_isolation` is an even more specialized version
of `run_bats_test_suite` to ensure that `PATH` is restricted to
`BATS_TEST_BINDIR` and the Bats `libexec/` directory within the suite.
Along with `stub_program_in_path` and `create_forwarding_script`, this
is useful for testing helper functions whose behavior depends on the
available system commands, such as `skip_if_...` helpers.
@mbland mbland added this to the v1.7.0 milestone Sep 1, 2017
@mbland mbland self-assigned this Sep 1, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 94.68% when pulling 0c0536a on run-script-helpers into 736eb12 on master.

@mbland mbland merged commit 0b44890 into master Sep 1, 2017
@mbland mbland deleted the run-script-helpers branch September 1, 2017 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants