Skip to content

Commit

Permalink
contend more strongly with spec/rails aggressive assault on RAILS_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
timcharper committed Jun 8, 2009
1 parent 7053743 commit 08eca65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions features/cucumber_rails_integration.feature
Expand Up @@ -26,8 +26,6 @@ Feature: Cucumber integration with rails
require 'cucumber' # I needed to add this... We could move this require to Spork if we think it is better there...
require 'cucumber/formatter/unicode' # Comment out this line if you don't want Cucumber Unicode support
require 'spec/rails' # I needed to add this as well to avoid the #records error...
Object.send(:remove_const, :RAILS_ENV)
Object.const_set(:RAILS_ENV, ENV['RAILS_ENV'].dup)
require 'cucumber/rails/rspec'
class ActiveRecord::Base
class << self
Expand Down
2 changes: 2 additions & 0 deletions lib/spork/app_framework/rails.rb
Expand Up @@ -63,6 +63,8 @@ def delay_application_controller_loading
def auto_reestablish_db_connection
if Object.const_defined?(:ActiveRecord)
Spork.each_run do
# spec/rails is very aggressive about overriding RAILS_ENV and will switch it back to test after the cucumber env was loaded
reset_rails_env
ActiveRecord::Base.establish_connection
end
end
Expand Down

0 comments on commit 08eca65

Please sign in to comment.