rspec / rspec-support

Common code needed by the other RSpec gems. Not intended for direct use.
https://rspec.info
MIT License
99 stars 102 forks source link

Master branch miscalculates the expected argument count when a hash is passed to rest of keywords #374

Closed twalpole closed 5 years ago

twalpole commented 5 years ago

Subject of the issue

Given an instance method on a class defined as

def test(arg, **options) ... end

when creating a verified partial double from an instance of that class that calling it

allow(some_object).to receive(:test) some_object.test('something', {})

the error Wrong number of arguments. Expected 1, got 2 is returned which is incorrect since the empty hash is accepted by the rest of keywords **options

JonRowe commented 5 years ago

Fixed in #375