rspec-mocks icon indicating copy to clipboard operation
rspec-mocks copied to clipboard

Matching argument on stub with range that cannot be iterated fails

Open chrisface opened this issue 8 years ago • 1 comments

When you have multiple stubs on a method with different arguments there is a check performed to see which stub should be called based on the argument.

If the argument is a range, a comparison is done to find which range the argument is within. This fails when the range is ActiveSupport::TimeWithZone or any other Time as they can not be iterated over.

Example test repo here demonstrating the problem: https://github.com/chrisface/rspec_bug/blob/master/example_spec.rb

chrisface avatar Oct 20 '17 13:10 chrisface

Hm thats unfortunate, if you'd like to make an attempt at fixing it I'll happily help review

JonRowe avatar Oct 22 '17 23:10 JonRowe

Closing due to inactivity during the monorepo migration.

JonRowe avatar Nov 27 '24 21:11 JonRowe