From a0178b812da90659af6ab37522474c1608aebc09 Mon Sep 17 00:00:00 2001 From: Phil Pirozhkov Date: Sat, 9 Jan 2021 03:01:47 +0300 Subject: [PATCH] Conditionally use shared_context_metadata_behavior See https://github.com/rspec/rspec-core/pull/2834 --- spec/spec_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d9e4eef338..12d9ced593 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -52,7 +52,8 @@ def self.run_all(reporter = nil) config.order = :random Kernel.srand config.seed - config.shared_context_metadata_behavior = :apply_to_host_groups + # shared_context_metadata_behavior is removed in RSpec 4 + config.shared_context_metadata_behavior = :apply_to_host_groups if config.respond_to?(:shared_context_metadata_behavior=) # Zero monkey patching mode is the default and only mode in RSpec 4 config.disable_monkey_patching! if config.respond_to?(:disable_monkey_patching!)