diff options
Diffstat (limited to 'spec/support/helpers/next_instance_of.rb')
-rw-r--r-- | spec/support/helpers/next_instance_of.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/support/helpers/next_instance_of.rb b/spec/support/helpers/next_instance_of.rb index 3c88715615d..5cc63fe5c6e 100644 --- a/spec/support/helpers/next_instance_of.rb +++ b/spec/support/helpers/next_instance_of.rb @@ -31,8 +31,9 @@ module NextInstanceOf receive_new.exactly(number).times end - target.to receive_new.and_wrap_original do |method, *original_args| - method.call(*original_args).tap(&blk) + target.to receive_new.and_wrap_original do |*original_args, **original_kwargs| + method, *original_args = original_args + method.call(*original_args, **original_kwargs).tap(&blk) end end end |