Skip to content

Commit 5bfbfff

Browse files
committed
Fix WrongScopeError being thrown on Rails master:
- ### Problem Rails made a change in rails/rails@d4367eb and TestFixtures don't make use of `method_name` anymore, but simply `name`. `name` on RSpec raises a `WrongScopeError` when called within an example. This patch overrides `name` to return the example name instead.
1 parent d0f81df commit 5bfbfff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/rspec/rails/fixture_support.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ def self.proxy_method_warning_if_called_in_before_context_scope(method_name)
5050
end
5151
end
5252

53+
def name
54+
@example
55+
end
56+
5357
fixtures RSpec.configuration.global_fixtures if RSpec.configuration.global_fixtures
5458
end
5559
end

0 commit comments

Comments
 (0)