[rspec-users] Basic Rspec operation questions

Zach Dennis zach.dennis at gmail.com
Wed Oct 8 15:51:31 EDT 2008

In your spec/spec_helper.rb file you should see a line at the to which
says RAILS_ENV="test". If you haven't modified your spec_helper.rb
file I would remove it and re-run "script/generate rspec". It should
be there. I just generated a new Rails project with rspec and
rspec-rails gems. Here's the top of my spec/spec_helper.rb:

# This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'spec'
require 'spec/rails'


On Wed, Oct 8, 2008 at 3:15 PM, Wes Gamble <weyus at att.net> wrote:
> With Rails, is "rake spec" supposed to automatically run under the test
> environment?  I have to do "rake spec RAILS_ENV=test" in order to get the
> environments/test.rb file to load.
> Also, are the standard Test::Unit fixtures automatically loaded before each
> test in each spec file?  This appears to be the case based on my current
> spec's behavior, but wanted to verify.
> Thanks,
> Wes
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

Zach Dennis

More information about the rspec-users mailing list