From 54b93393509ef1da083ad8e16c854b0f0740f8bf Mon Sep 17 00:00:00 2001 From: Odin H B Date: Mon, 21 Jun 2021 21:43:50 +0200 Subject: [PATCH] Deprecate currently_executing_a_context_hook? --- lib/rspec/core/example_group.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/rspec/core/example_group.rb b/lib/rspec/core/example_group.rb index 5efee9f386..d3bca29b78 100644 --- a/lib/rspec/core/example_group.rb +++ b/lib/rspec/core/example_group.rb @@ -537,9 +537,15 @@ def self.store_before_context_ivars(example_group_instance) end end + # @deprecated use `RSpec.current_scope` instead # Returns true if a `before(:context)` or `after(:context)` # hook is currently executing. def self.currently_executing_a_context_hook? + RSpec.deprecate( + "currently_executing_a_context_hook", + :replacement => "RSpec.current_scope" + ) + @currently_executing_a_context_hook end