Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is issue rspec#1191. Previously, a few parts of the Include matcher assumed all Ranges were iterable. This caused it to raise errors like: TypeError: Can't iterate from [Float|Time] This happens because Ranges require that their beginning element implement succ. Float doesn't which causes the error. Time is different because it does implement succ but a) it's deprecated as of Ruby 1.9.2 and b) some Ruby implementations raise an exception when trying to iterate through a range of Time objects. This PR does a few things: 1) Fixes the Include matcher to handle Ranges that don't support iteration (while continuing to support Ranges that do) This PR does a few things: 1) Fixes the Include matcher to handle Ranges that don't support iteration (while continuing to support Ranges that do) 2) Adds specs for both types of Ranges in 1) (There weren't any for the Include matcher with Ranges previously)
- Loading branch information