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 causes specs error in Ruby 1.8.6 #18

Closed
sferik opened this issue Nov 30, 2010 · 7 comments
Closed

SimpleCov causes specs error in Ruby 1.8.6 #18

sferik opened this issue Nov 30, 2010 · 7 comments

Comments

@sferik
Copy link
Collaborator

sferik commented Nov 30, 2010

Trace: https://gist.github.com/dda22fa6e6c8c9b3974a

SimpleCov should throw a warning and skip coverage analysis in Ruby 1.8.6 (as in 1.8.7).

MRI 1.8.6 is still widely used in development since it shipped with Mac OS X 10.5.

@colszowka
Copy link
Collaborator

This shouldn't fail, and in fact there is a mechanism that keeps Simplecov from executing on 1.8 Rubies. I'll have a look as to why this still could've happened, thanks for the report

@sferik
Copy link
Collaborator Author

sferik commented Dec 3, 2010

Thanks for looking into it. You should be able to reproduce with:
git clone git://github.com/jnunemaker/twitter.git
cd twitter
bundle install
bundle exec rake spec

I was using Ruby 1.8.6 patchlevel 399.

@colszowka
Copy link
Collaborator

Added unit tests that verify the correct fallback behaviour on 1.8.x. Closed by 48cbb2e

@colszowka
Copy link
Collaborator

OK, I finally had the time to look into this. I've identified the problem and solved it (the trouble was that SimpleCov.configure did not have a fallback for non-1.9-Ruby)

The actual commit holding the fix is SHA: a7b582a

Along the way I've also added facilities to test SimpleCov on multiple Ruby versions, so the unit tests now verify that loading SimpleCov on 1.8-Rubies does not make everything go down the drain.

Thanks for the patience, please let me know whether this works for you, the release of version 0.3.8 starts as soon as this comment is submitted.

@sferik
Copy link
Collaborator Author

sferik commented Jan 6, 2011

I upgraded to 0.3.8. Now I'm getting

uninitialized constant SimpleCov::VERSION (NameError)

Here the full trace: https://gist.github.com/225c67bef97a37a146f7

@colszowka
Copy link
Collaborator

SHIT!

That's caused by the migration from Jeweler to Bundler and did not bump up in the tests since I'm loading bundler there. 0.3.9 is pushed, yanking 0.3.8 in a minute!

@colszowka
Copy link
Collaborator

OK, I've tried it with the twitter gem, and coverage is correctly skipped for 1.8.7 and generated for 1.9.2 with simplecov 0.3.9. Sorry for messing up that 0.3.8 release!

However, on 1.8.6, the twitter gem's test suite is failing, but not due to Simplecov. Here's the top of the stack trace:

/Users/colszowka/.rvm/gems/ruby-1.8.6-p399/gems/rack-1.2.1/lib/rack/utils.rb:138:in `union': can't convert Array into String (TypeError)
    from /Users/colszowka/.rvm/gems/ruby-1.8.6-p399/gems/rack-1.2.1/lib/rack/utils.rb:138
    from /Users/colszowka/.rvm/gems/ruby-1.8.6-p399/gems/faraday-0.5.3/lib/faraday/utils.rb:1:in `require'

When I uncommented the simplecov setup in the spec helper, the same exception occured, so it obviously is a problem with the twitter gem itself.

Luckily for me though, this seems to prove that simplecov fires up on 1.8.6 without trouble, since the actual loading of the library has been reached :)

Here's how I fired up the test suite after git clone:

rvm 1.8.6,1.8.7,1.9.2 exec bundle install
rvm 1.8.6,1.8.7,1.9.2 rake spec

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