0

Like the headline said, I am getting the aforementioned error when I try to run my rspec tests. The exact error is (word wrapped for readability):

/.rvm/gems/ruby-1.9.3-p374/gems/test-unit-2.4.8/lib/test/unit/testcase.rb:93:in
 `<class:TestCase>': uninitialized constant 
   Test::Unit::TestCase::Assertions (NameError)

The main fix for this problem on the internet seems to be to remove the 'turn' gem, however I don't have the turn gem loaded. Here is my Gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.8'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'devise'
gem 'therubyracer'
gem 'mysql2'
gem 'cucumber'
gem 'email_spec'
gem 'cancan'
gem 'rolify'
gem 'libv8'
gem 'simple_form'

group :test, :development do
  gem 'rspec-rails'
  gem 'factory_girl_rails'
  gem 'test-unit'
end

group :test do
  gem 'cucumber-rails', :require => false
  gem 'capybara'
  gem 'database_cleaner'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'coffee-rails', '~> 3.2.1'
  gem 'bootstrap-sass'
  gem 'sass-rails',   '~> 3.2.3'
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

The part of my code that the test seems to be choking on is when I have this line in my require 'rspec/rails' in my rspec_helper.rb file.

This project used to run rspecs flawlessly. It's only when I did a reinstall of my OS that it began to behave badly.

Any help is greatly appreciated

user229044
  • 232,980
  • 40
  • 330
  • 338
Black Dynamite
  • 4,067
  • 5
  • 40
  • 75
  • Please don't use external services like pastebin. If you have something you want to put in your question, *put it in your question*. – user229044 Jan 21 '13 at 20:10
  • @meagar Thanks meager. I was worried that putting the Gem file in there would lead to my post being too chunky. Good to know I can put all the pertinent data in one place. – Black Dynamite Jan 21 '13 at 20:14
  • You don't have the versions of your gems locked, so it's not too surprising that you got some breakage when you installed them fresh. Out of curiosity, can you look in your `Gemfile.lock` file to see if `turn` got included as a dependency? –  Jan 21 '13 at 20:16
  • @IsaacCambron I checked my Gemfile.lock file, a CTRL+F showed no turn dependencies. I still have access to my old system, do you think I should check my gem versions between the new and old system and try to smoke it out there ? – Black Dynamite Jan 21 '13 at 20:28
  • It's what I'd do, yeah. You might even start by looking at the old Gemfile.lock and just setting all the of the versions in the new Gemfile to match it. Then things should definitely work. –  Jan 21 '13 at 20:30
  • 1
    @IsaacCambron Okay Isaac, that wasn't the solution but it lead me in the right direction. Apparently, including the gem 'test-unit' is what caused it to choke out, why I don't know. Also, I did heed your advice and lock my gems to avoid having to make a u-turn back to StackOverflow at a later date. – Black Dynamite Jan 21 '13 at 20:50

2 Answers2

3

Since your are not generating a new app, remove the line

gem 'test-unit'

from your Gemfile and remove the gems turn and minitest, followed by a bundle update.

Paulo Fidalgo
  • 21,709
  • 7
  • 99
  • 115
1

Answer: If you look in my Gemfile, you see a requirement in my group :test, :development for gem 'test-unit'. I commented that out and it works like a charm. Why and how this works I have no idea, if someone would mind explaining go right ahead.

Black Dynamite
  • 4,067
  • 5
  • 40
  • 75
  • 1
    Rather than submitting your own answer, you should probably up-vote and accept Paulo Fidalgo's [answer](http://stackoverflow.com/a/14446371/229044), since this is the exact solution he suggested 40 minutes ago. – user229044 Jan 21 '13 at 21:02
  • @meagar My goodness. His first answer involved something about turn so I had tuned him out. Turns out he **was** right ! – Black Dynamite Jan 21 '13 at 21:09