Skip to content

Conversation

@mbland
Copy link
Owner

@mbland mbland commented Jan 13, 2017

More work pertaining to #40.

Introduces the new stub_program_in_path function in lib/bats/helpers, which makes it super easy to stub out system programs by injecting testing stub implementations into the PATH of tests that call the function.

Also updates a number of tests to use the assert_file_* functions, and includes new comments and test cases indicating how to check for completely empty output or files.

Much easier and more convenient than having to hand-roll `PATH` program
stubs for every new test suite.
Also documents how to check for completely empty output or files, both
in assertion comments and with new test cases in
`tests/assertions.bats`.
@mbland mbland added this to the v1.3.0 milestone Jan 13, 2017
@mbland mbland self-assigned this Jan 13, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 94.771% when pulling a2fbfe1 on stub-program-assert-file-#40 into e7c0ba3 on master.

@mbland mbland merged commit d25e5d3 into master Jan 13, 2017
@mbland mbland deleted the stub-program-assert-file-#40 branch January 13, 2017 04:06
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