Skip to content

Commit

Permalink
Merge pull request #2511 from rspec/use-rspec-current_scope
Browse files Browse the repository at this point in the history
Use RSpec.current_scope
  • Loading branch information
JonRowe committed Feb 9, 2022
2 parents 58fee01 + 6489ae6 commit 620a869
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rspec/rails/fixture_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def fixtures(*args)
def proxy_method_warning_if_called_in_before_context_scope(method_name)
orig_implementation = instance_method(method_name)
define_method(method_name) do |*args, &blk|
if inspect.include?("before(:context)")
if RSpec.current_scope == :before_context_hook
RSpec.warn_with("Calling fixture method in before :context ")
else
orig_implementation.bind(self).call(*args, &blk)
Expand Down

0 comments on commit 620a869

Please sign in to comment.