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

Empty last hash matches allow any kwargs #375

Closed twalpole closed 5 years ago

twalpole commented 5 years ago

This fixes issue #374

JonRowe commented 5 years ago

Ok, you'll need a spec for this, also consider not everything responds to empty?...

twalpole commented 5 years ago

@JonRowe At that point args.last is guaranteed to be a Hash so it is guaranteed to respond to empty? and there is a spec already in the PR.

twalpole commented 5 years ago

@JonRowe - Just a friendly ping

benoittgt commented 5 years ago

Sorry for the late review. This patch looks good to me. Because we do Hash === args.last as the first condition we are sure arg.last.empty? is done on the proper type. Also @JonRowe I don't understand which test we should add.

For the failing on appveyor. It is unrelated. https://ci.appveyor.com/project/rspec/rspec-support/builds/23996036/job/egb1o129jo145r0t

JonRowe commented 5 years ago

Thanks :)