Skip to content

Commit

Permalink
[expectations] Merge pull request rspec/rspec-expectations#1258 from …
Browse files Browse the repository at this point in the history
…rspec/conditionally-use-disable_monkey_patching

Make specs inter-dependent, and backwards compatible'ish

---
This commit was imported from rspec/rspec-expectations@a86200a.
  • Loading branch information
JonRowe authored Dec 26, 2020
2 parents dafabc8 + d515be4 commit 6ee774a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def should_not(*)
rspec.expose_dsl_globally = false

rspec.mock_with :rspec do |mocks|
mocks.syntax = :expect
mocks.syntax = :expect if mocks.respond_to?(:syntax=) # RSpec 4 removed `syntax=`
end

rspec.expect_with :rspec do |expectations|
Expand Down
2 changes: 1 addition & 1 deletion rspec-expectations/features/syntax_configuration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Feature: Syntax Configuration
expectations.syntax = :should
end
config.mock_with :rspec do |mocks|
mocks.syntax = :should
mocks.syntax = :should if mocks.respond_to?(:syntax=) # RSpec 4 removed `syntax=`
end
end
"""
Expand Down
2 changes: 1 addition & 1 deletion rspec-expectations/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def hash_inspect(hash)
mocks.verify_partial_doubles = true
end

config.disable_monkey_patching!
config.disable_monkey_patching! if config.respond_to?(:disable_monkey_patching!) # RSpec 4 dropped this method

# We don't want rspec-core to look in our `lib` for failure snippets.
# When it does that, it inevitably finds this line:
Expand Down

0 comments on commit 6ee774a

Please sign in to comment.