Korsmakolnikov
Korsmakolnikov

Reputation: 709

Is test-unit incompatible with ruby 2.2.0?

I'm really new to ruby. I'm starting to play following this guide for setting up ruby, rvm, update all my mac to current version, without any problem. So I installed test-unit gem and try some TDD script. Running the test nothing happen. So I run ruby with "-d" option and this happen.

Exception 'LoadError' at /Users/BlackSheep/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems.rb:1222 - cannot load such file -- rubygems/defaults/operating_system

Exception 'LoadError' at /Users/BlackSheep/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems.rb:1231 - cannot load such file -- rubygems/defaults/ruby

Exception `LoadError' at /Users/BlackSheep/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54 - cannot load such file -- test/unit

Exception 'NoMethodError' at /Users/BlackSheep/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1984 - undefined method `to_ary' for #

Exception 'NoMethodError' at /Users/BlackSheep/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1984 - undefined method 'to_ary' for #

what could be the problem?

Versions:

Edit: I've downgrade to version 2.0.0 and it works fine. So test-unit gem is not made for current ruby version?

Upvotes: 0

Views: 630

Answers (1)

Daniel Bernier
Daniel Bernier

Reputation: 188

Up to 2.1, Ruby shipped with test/unit, but as of 2.2, it's been removed.

It's still available as a gem: https://github.com/test-unit/test-unit/. From the README: "Test::Unit 1.2.3 is the original Test::Unit, taken straight from the ruby distribution. It is being distributed as a gem to allow tool builders to use it as a stand-alone package. (The test framework in ruby is going to radically change very soon)."

If you make sure the test-unit gem is install (either gem install test-unit or add gem 'test-unit' to your Gemfile) it should solve the problem.

Upvotes: 1

Related Questions