Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RSpec #log_deprecation matcher error when #log_deprecation uses :key #3781

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading