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

ruby 2.2.0 rails 4.0.13 and rspec 3.1.0 cannot load such file -- test/unit/assertions #1273

Closed
waynehoover opened this issue Jan 13, 2015 · 14 comments

Comments

@waynehoover
Copy link

Hello, I'm getting this error, any ideas why? `require': cannot load such file -- test/unit/assertions

~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:229:in `require': cannot load such file -- test/unit/assertions (LoadError)

The stack trace points to this line in my spec_helper:require 'rspec/rails'

@waynehoover
Copy link
Author

I figured it out.

You have to add the test-unit gem to your gemfile: gem 'test-unit'

@cupakromer
Copy link
Member

This is related to #1264. It should be fixed in the next release. You should just need the minitest gem, it sets up the proper test unit shims.

@rohandaxini
Copy link

I had to add both, test-unit and minitest gems to make this work. So both are fine or am I doing anything wrong here?

@cupakromer
Copy link
Member

@rohandaxini you should not need the test-unit gem unless you have something else that is loading test unit specifically. The minitest gem handles setting up the proper constant aliases. What problem did you run into?

@rohandaxini
Copy link

Thanks for your note @cupakromer
Actually I was facing this error while running my tests (rspec test suite) on local.

/my_computer/.rvm/gems/ruby-2.2.0/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- test/unit/testcase (LoadError)

This has happened recently when I upgraded to Ruby2.2.0, earlier I was not facing this error on Ruby 2.1.2 or 2.1.5

I found this git issue and thought to add test-unit after other error went away by adding minitest
But I am sure, I am doing something wrong that has led me to add both these gems. Thoughts ?

btw, while upgrading to Ruby 2.2.0, I have no other code change except in Gemfile. My new entires in Gemfile are:
ruby '2.2.0'
gem 'eventmachine', '1.0.4'

Accordingly my Gemfile.lock has changes only related to these 2 gems.

@cupakromer
Copy link
Member

Thanks for the background information. Have you tried just removing test-unit from your Gemfile and only having minitest?

@cupakromer
Copy link
Member

Ok, I just noticed your gem file location. You are running Rails 3.2 not Rails 4.0 which is what this issue is about. Rails hasn't officially started supporting Ruby 2.2 on Rails 3.2 yet (you can see they are working on it in the git history). As such rspec-rails has started to prepare for this in #1277. However, as it stands now we will only be supporting the latest patch release (and above) which has the fixes for Ruby 2.2 support.

@rohandaxini
Copy link

Thanks a lot for your detailed note @cupakromer This is really helpful and I now understood the problem due to Rails 3.2.

Sorry my bad :(
Yeah saw those links and glad to see the progress.

@PragTob
Copy link

PragTob commented Jan 29, 2015

Hi there, thanks for rspec and everything :) Could we get a release soon-ish please? This problem is still really bugging us so a release soon-ish would really be appreciated :)

@myronmarston
Copy link
Member

@PragTob -- I'm planning on releasing 3.2 tomorrow or early next week. If there's no 3.2 release in the next 7 days, you have my permission to hound me until it's out :).

@PragTob
Copy link

PragTob commented Jan 30, 2015

Thank you very much @myronmarston - you're awesome so much ❤️ ❤️ ❤️ 💚

@jasnow
Copy link
Contributor

jasnow commented Feb 9, 2015

@myronmarston - I can use the "3.2 fix" too.

@PragTob
Copy link

PragTob commented Feb 9, 2015

@jasnow 3.2.0 was released on the third of February, you should be able to install it.

Thanks Myron!

@nacengineer
Copy link

Not sure why a question on Rails 4 devolved into Rails 3 is broken but see OP's solution

You have to add the test-unit gem to your gemfile: gem 'test-unit'

@rspec rspec locked and limited conversation to collaborators Mar 30, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants