Skip to content
Browse files

Revert "use closure scope locals rather than ivars (eliminates warnin…

…gs, Im not sure why the ivars are bing lost)"

This partially reverts commit 86aea05.

Thanks to @thomasfedb for the first proposed solution.
Resolves #905
  • Loading branch information...
1 parent cff0228 commit b731d917463840da82c3e783baef5c2a4f392f1d @alindeman alindeman committed
Showing with 5 additions and 6 deletions.
  1. +2 −3 lib/rspec/rails/example/controller_example_group.rb
  2. +3 −3 spec/spec_helper.rb
View
5 lib/rspec/rails/example/controller_example_group.rb
@@ -68,9 +68,8 @@ def self.name
end
metadata[:example_group][:described_class].class_eval(&body)
- orig_routes = nil
before do
- orig_routes = self.routes
+ @orig_routes = self.routes
resource_name = @controller.respond_to?(:controller_name) ?
@controller.controller_name.to_sym : :anonymous
self.routes = ActionDispatch::Routing::RouteSet.new.tap { |r|
@@ -79,7 +78,7 @@ def self.name
end
after do
- self.routes = orig_routes
+ self.routes = @orig_routes
@orig_routes = nil
end
end
View
6 spec/spec_helper.rb
@@ -19,10 +19,11 @@ def self.run_all(reporter=nil)
end
RSpec.configure do |config|
- real_world = nil
-
config.filter_run :focus
config.run_all_when_everything_filtered = true
+ config.order = :random
+
+ real_world = nil
config.before(:each) do
real_world = RSpec.world
RSpec.instance_variable_set(:@world, RSpec::Core::World.new)
@@ -30,5 +31,4 @@ def self.run_all(reporter=nil)
config.after(:each) do
RSpec.instance_variable_set(:@world, real_world)
end
- config.order = :random
end

0 comments on commit b731d91

Please sign in to comment.
Something went wrong with that request. Please try again.