Skip to content

Commit a0178b8

Browse files
committed
Conditionally use shared_context_metadata_behavior
See rspec/rspec-core#2834
1 parent 7b6ded8 commit a0178b8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spec/spec_helper.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def self.run_all(reporter = nil)
5252
config.order = :random
5353
Kernel.srand config.seed
5454

55-
config.shared_context_metadata_behavior = :apply_to_host_groups
55+
# shared_context_metadata_behavior is removed in RSpec 4
56+
config.shared_context_metadata_behavior = :apply_to_host_groups if config.respond_to?(:shared_context_metadata_behavior=)
5657

5758
# Zero monkey patching mode is the default and only mode in RSpec 4
5859
config.disable_monkey_patching! if config.respond_to?(:disable_monkey_patching!)

0 commit comments

Comments
 (0)