Skip to content

Commit

Permalink
standard trying to ruin my tests
Browse files Browse the repository at this point in the history
  • Loading branch information
p committed Nov 15, 2024
1 parent 192ae0a commit 66819d8
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions spec/datadog/di/instrumenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@
include_examples 'invokes callback and captures parameters'

context 'when passed via a splat' do

let(:target_call) do
expect(HookTestClass.new.hook_test_method_with_arg(*[2])).to eq 2
args = [2]
expect(HookTestClass.new.hook_test_method_with_arg(*args)).to eq 2
end

include_examples 'invokes callback and captures parameters'
Expand Down Expand Up @@ -167,9 +167,9 @@
include_examples 'invokes callback and captures parameters'

context 'when passed via a splat' do

let(:target_call) do
expect(HookTestClass.new.hook_test_method_with_kwarg(**{kwarg: 42})).to eq 42
kwargs = {kwarg: 42}
expect(HookTestClass.new.hook_test_method_with_kwarg(**kwargs)).to eq 42
end

include_examples 'invokes callback and captures parameters'
Expand Down Expand Up @@ -205,16 +205,18 @@
# TODO actual argument name not captured yet,
# requires method call trace point.
arg1: {type: 'Integer', value: '41'},
kwarg: {type: 'Integer', value: '42'})
kwarg: {type: 'Integer', value: '42'}
)
end
end

include_examples 'invokes callback and captures parameters'

context 'when passed via a splat' do

let(:target_call) do
expect(HookTestClass.new.hook_test_method_with_pos_and_kwarg(*[41], **{kwarg: 42})).to eq [41, 42]
args = [41]
kwargs = {kwarg: 42}
expect(HookTestClass.new.hook_test_method_with_pos_and_kwarg(*args, **kwargs)).to eq [41, 42]
end

include_examples 'invokes callback and captures parameters'
Expand Down

0 comments on commit 66819d8

Please sign in to comment.