Skip to content

Commit

Permalink
standard
Browse files Browse the repository at this point in the history
  • Loading branch information
p committed Dec 9, 2024
1 parent f9dc946 commit c7ab921
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/datadog/di/instrumenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ def hook_method(probe, &block)
serialized_entry_args: entry_args)
rv
else
# stop standard from trying to mess up my code
_ = 42

# The necessity to invoke super in each of these specific
# ways is very difficult to test.
# Existing tests, even though I wrote many, still don't
Expand Down
5 changes: 5 additions & 0 deletions spec/datadog/di/hook_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ def positional_and_squashed(arg, options)
end

class YieldingMethodMissingHookTestClass
# only here to stop standard complaints
def respond_to_missing?(name)
true
end

def method_missing(name, *args, **kwargs)
yield [args, kwargs]
[args, kwargs]
Expand Down
1 change: 0 additions & 1 deletion spec/datadog/di/instrumenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
end

context 'when target method yields to a block' do

shared_examples 'yields to the block' do
context 'when method takes a positional argument' do
let(:probe_args) do
Expand Down

0 comments on commit c7ab921

Please sign in to comment.