Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit b731d917463840da82c3e783baef5c2a4f392f1d 1 parent cff0228
@alindeman alindeman authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.