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

rake cucumber fails on new rails 4 project with both rspec and cucumber #792

Closed
mathie opened this issue Jul 25, 2013 · 9 comments
Closed

Comments

@mathie
Copy link

mathie commented Jul 25, 2013

Just getting started on a new project – my first attempt with Rails 4 – and I've run into a minor snag. I've generated a demo project to show it off here: mathie/broken_cucumber_demo. Having installed and generated cucumber at mathie/broken_cucumber_demo@7474454, running rake or rake cucumber works fine.

However, after installing and generating rspec (in mathie/broken_cucumber_demo@c208712a149059c260bcdbe48ef204d0f42178e1), running rake cucumber results in:

/Users/mathie/.rbenv/versions/2.0.0-p247/bin/ruby -S bundle exec cucumber  --profile default
DEPRECATION WARNING: ActionController::Integration is deprecated and will be removed, use ActionDispatch::Integration instead. (called from require at /Users/mathie/Development/Personal/broken_cucumber_demo/features/support/env.rb:7)
DEPRECATION WARNING: ActionController::IntegrationTest is deprecated and will be removed, use ActionDispatch::IntegrationTest instead. (called from require at /Users/mathie/Development/Personal/broken_cucumber_demo/features/support/env.rb:7)
Using the default profile...
0 scenarios
0 steps
0m0.000s
/Users/mathie/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/minitest-4.7.5/lib/minitest/unit.rb:1037:in `block in process_args': invalid option: --profile (OptionParser::InvalidOption)
        from /Users/mathie/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/minitest-4.7.5/lib/minitest/unit.rb:1016:in `new'
        from /Users/mathie/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/minitest-4.7.5/lib/minitest/unit.rb:1016:in `process_args'
        from /Users/mathie/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/minitest-4.7.5/lib/minitest/unit.rb:1066:in `_run'
        from /Users/mathie/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/minitest-4.7.5/lib/minitest/unit.rb:1059:in `run'
        from /Users/mathie/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/minitest-4.7.5/lib/minitest/unit.rb:795:in `block in autorun'

The backtrace suggests some autorun shenanigans, so I tried commenting out require 'rspec/autorun' from the spec helper, but that doesn't seem to have helped.

I've reported this issue to cucumber/cucumber-rails#253 too, but I suspect it's more likely to be rspec...

Any thoughts?

@JonRowe
Copy link
Member

JonRowe commented Jul 25, 2013

This is because the latest version of minitest seems to be invoked by one of the requires, which blows up with the --profile default

I think the require changed it's behaviour, so if it's rspec requiring the latest version of minitest we need to change that require or lock the minitest version.

@JonRowe
Copy link
Member

JonRowe commented Jul 25, 2013

From a straight up clone of your demo, rake works for me. The bundle installs minitest (4.7.5). I think it's minitest 5 that causes this problem.

@mathie
Copy link
Author

mathie commented Jul 25, 2013

Just to summarise the conversation with @JonRowe on Twitter ... It's definitely minitest 4.7.5 that's being activated here (I removed minitest 5.0.6 entirely, just to make sure). It occurs if I invoke rake via bundle exec, too.

Seeing as it's a new project, I'm using Ruby 2.0.0-p247. However, I'm still getting the same failure with 1.9.3-p448.

It does start working if I disable ActiveRecord entirely, as in mathie/broken_cucumber_demo@598eac09091e867b681c04b0cc3f6e3155d7b35a.

@JonRowe
Copy link
Member

JonRowe commented Jul 25, 2013

Interesting... Thats what I did to avoid setting up a db. (I'm also on Ruby 2)

@JonRowe
Copy link
Member

JonRowe commented Jul 25, 2013

This isn't an RSpec issue, I've described this in more detail in cucumber/cucumber-rails#253 but the problem is that minitest autorun has been kicked in by cucumber. If you look at the output both suites run successfully then minitest blows up afterwards.

@JonRowe JonRowe closed this as completed Jul 25, 2013
@rainerfrey
Copy link

I get that behavior with ruby 2.0.0-p247, rails 4.0.1, rspec-rails (2.14.0) without cucumber. Minitest version in bundle is 4.7.5

@JonRowe
Copy link
Member

JonRowe commented Dec 1, 2013

Please make sure you don't have another gem requiring minitest\autorun or rails\test_help and run bundle update rspec-rails to ensure you have the latest version of all the rspec gems.

@rainerfrey
Copy link

If this is definitely not rspec-rails that does the "offending" require, can someone give me a hint on how to trace where the require might come from (apart from reviewing the source code of all gems in a current rails application).

I get a very similar stack trace as above, with only Test::Unit and minitest in it.

@rainerfrey
Copy link

Nevermind, found it myself. It was the turn gem that was left over in my Gemfile

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

3 participants