Skip to content

shpec aborts test run early with no error message if 'set -e' used #128

Description

@edmorley

STR:

  1. Create a shpec test file that enables bash exit on error (set -e at the top of the file)
  2. Add a test like:
     	it "foo"
     		function_under_test_that_returns_non_zero
     		result=$?
     		assert equal "${result}" 1
     	end
  3. Add some more tests, after that test in the file (they can be anything)
  4. Run the tests

Expected:

shpec runs all tests. Or if bash exit on error isn't supported, then this be documented in the shpec readme.

Actual:

shpec does not run any test after the non-test after step 2 - ie: aborts the test run early. There is no visible error message or failing test output shown, albeit the shpec exit code is non-zero. However when working with shpec locally rather than CI, this non-zero exit code isn't much use - it seems like the tests all passed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions