Skip to content
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

simplecov BREAKS rspec #5

Closed
danielb2 opened this issue Sep 2, 2010 · 7 comments
Closed

simplecov BREAKS rspec #5

danielb2 opened this issue Sep 2, 2010 · 7 comments

Comments

@danielb2
Copy link

danielb2 commented Sep 2, 2010

require 'simplecov'
SimpleCov.start
describe 'exit status' do
  it "should exit with a non-zero exit status when assertion fails" do
    1.should == 2
  end
end

Put the above code in a file, run the file.

echo $?
=> 0

it should return 1

@danielb2
Copy link
Author

danielb2 commented Sep 2, 2010

Example run:

[~/tmp]$ rspec exit_status_spec.rb 
F

Failures:
  1) exit status should exit with a non-zero exit status when assertion fails
    Failure/Error: 1.should == 2
    expected: 2,
          got: 1 (using ==)
    Diff:
    @@ -1,2 +1,2 @@
    -2
    +1
    # ./exit_status_spec.rb:5:in `block (2 levels) in <top (required)>'

Finished in 0.00226 seconds
1 example, 1 failure
Coverage report generated for /Users/daniel/.rvm/gems/ruby-1.9.2-p0/bin/rspec exit_status_spec.rb to /Users/daniel/tmp/coverage

[~/tmp]$ echo $?
0

@colszowka
Copy link
Collaborator

I see. This might have to do with the at_exit handler in simplecov not propagating RSpecs actual exit status correctly.

I will have a look, thanks for reporting this!

@colszowka
Copy link
Collaborator

Make sure the correct exit status is propagated from tests when running
simplecov.

Closed by 20d6a8c

@colszowka
Copy link
Collaborator

This bug should be fixed with version 0.3.5. It seems that the wrong return code only appeared when not invoking tests via rake. Unit tests for this specific error are included and this should work as expected from now on. Sorry for the trouble.

@danielb2
Copy link
Author

danielb2 commented Sep 3, 2010

cool, thanks :)

@danielb2
Copy link
Author

danielb2 commented Sep 3, 2010

confirmed working, btw

@colszowka
Copy link
Collaborator

Great, thanks for confirming and the error report :)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants