This project is archived and is in readonly mode.
rake environment for test tasks
-
Ryan Bigg
- State changed from new to needs-more-info
- Importance changed from to Low
I tried duplicating this by calling Rails.env in a
beforein a spec, but it outputs "test". Please add steps to reproduce. -
mark
http://github.com/markiz/rspec_testzor freshly generated app (steps: updated Gemfile to include rspec, bundle install, rails generate rspec:install, rails generate model testz (wouldn't work without a migration), rake db:migrate, created test/unit/testz_test.rb and spec/models/testz_spec.rb)
-
David Trasbo
Just tested it with a Rails 3.0.0.beta4 app I have lying around that uses RSpec 2. Putting a simple
raise Rails.envin one of the spec files shows thattestis being used.It's a completely standard setup with all test-related gems in the
:testgroup in theGemfile- includingrspec-rails,mocha,factory_girl,shoulda, and so on.Mark, if you're still having this issue, I'm having a feeling you should report it to the people behind RSpec instead.
This can be closed.
-
mark
You could set Rails.env in your spec_helper explicitly which would resolve the issue, but it is the default combination of rake tasks that creates the subject problem.
The thing should be reproducable since I supplied a test-repo in a comment above.
-
David Trasbo
Mark,
I've worked out what's wrong. You're using
rspec-railsversion 2.0.0.beta13. The app I tested used beta12. As soon as I changed the 12 to a 13, didbundle installthe specs were run in development environment.This clearly shows that this is not a Rails issue. I suggest you simply downgrade, and wait till it's fixed. And also, of course, report the issue here: https://rspec.lighthouseapp.com/projects/5645-rspec/tickets
-
Rohit Arondekar
- State changed from needs-more-info to invalid
Great work David! :)
Mark, closing ticket for now. Please report the issue at the RSpec issue tracker and see what happens there.
-
mark
Thanks.