This project is archived and is in readonly mode.
Gem Plugin does not load rails/init.rb when config.gem is placed in development.rb
-
Chris Jones
I can confirm this issue in Rails 2.3.5. Here are steps to reproduce:
Add the following to
config/test.rb:config.gem "webrat" config.gem "contest" config.gem "stories"Generate a new integration test and add the following in the test class:
story "Show that the bug is valid" do scenario "With webrat" do visit "/" end endInstall gems with
rake gems:installand thenrake test:integration. The test will fail:Started E Finished in 0.051676 seconds. 1) Error: test_With_webrat(SignUpTest::TestShowThatTheBugIsValid): NoMethodError: undefined method `visit' for #<SignUpTest::TestShowThatTheBugIsValid:0x102288180> /test/integration/sign_up_test.rb:8:in `test_With_webrat' 1 tests, 0 assertions, 0 failures, 1 errorsIt fails because the code in
rails/init.rbin the Stories gem is not executed.Note that configuring the gem dependencies in
config/environment.rb, like Brad says, works as expected. (Also note that you can wrap those same dependencies withif RAILS_ENV == "test"to load them only in the test environment.) -
Rohit Arondekar
- Importance changed from to
Any updates here? This is still an issue on latest 2.x or 3.x releases?
-
Santiago Pastorino
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale