Skip to content

Commit

Permalink
Merge pull request #3781 from DataDog/fix/rspec_log_deprecation_match…
Browse files Browse the repository at this point in the history
…er_limit_arg

Fix RSpec #log_deprecation matcher error when #log_deprecation uses :key
  • Loading branch information
delner authored Jul 12, 2024
2 parents 2a662b0 + ed52bfd commit f867bd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/support/core_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module CoreHelpers
# expect { subject }.to_not log_deprecation(include('no_longer_deprecated_option'))
RSpec::Matchers.define :log_deprecation do |message_matcher|
match(notify_expectation_failures: true) do |block|
expect(::Datadog::Core).to receive(:log_deprecation).with(no_args) do |&message_block|
expect(::Datadog::Core).to receive(:log_deprecation).with(any_args) do |&message_block|
expect(message_block.call).to match(message_matcher) if message_matcher
end

Expand All @@ -26,7 +26,7 @@ module CoreHelpers

match_when_negated(notify_expectation_failures: true) do |block|
if message_matcher
allow(::Datadog::Core).to receive(:log_deprecation).with(no_args) do |&message_block|
allow(::Datadog::Core).to receive(:log_deprecation).with(any_args) do |&message_block|
expect(message_block.call).to_not match(message_matcher)
end
else
Expand Down

0 comments on commit f867bd9

Please sign in to comment.