[rspec-users] RSpec-rails 1.2.2: autospec passes but "rake spec" fails

Stephen Eley sfeley at gmail.com
Fri Mar 27 16:03:33 EDT 2009

On Fri, Mar 27, 2009 at 8:36 AM, David Chelimsky <dchelimsky at gmail.com> wrote:
> You can also change spec_helper.rb to force the test environment with:
>  ENV["RAILS_ENV"] = 'test'
> That's what it used to do but somebody complained that it shouldn't
> force an environment :)

Yeah.  Running tests in the 'test' environment?  What were you
thinking?  That's almost as ridiculous as expecting the 'rails'
command to create a Rails app!  >%-\

It might be that your positive comment on my Lighthouse ticket
yesterday is going to my head, but it seems to me that the arrow of
work here is backwards.  The reason for having a generated skeleton,
including spec_helper.rb, is to give people sensible starter code with
defaults for sensible cases.  99% of Rails users are going to want to
run their Rspec behaviors in 'test' every time.  Setting the
environment to 'test' is therefore sensible.

People with edge cases are more likely to know what they're doing, and
should know that they can change that one line to add the '||=' or
comment it out completely.  The people who are most likely to be
impacted by the less forceful spec_helper are probably newer users who
don't understand shells and environments quite as well, and might be
running in 'one-click' Rails setups that set the environment for them
without them knowing about it.

Have Fun,
   Steve Eley (sfeley at gmail.com)
   ESCAPE POD - The Science Fiction Podcast Magazine

More information about the rspec-users mailing list