-
-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include
breaks with a time/float ranges
#1191
Comments
It breaks on Float as well.
|
include
breaks with a time rangeinclude
breaks with a time/float ranges
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)
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)
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)
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)
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)
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 2) Adds specs for both types of Ranges in 1). There weren't any for the Include matcher used with Ranges.
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 2) Adds specs for both types of Ranges in 1). There weren't any for the Include matcher used with Ranges.
@bclayman-sq Certainly. We're always watching. 👀 |
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 2) Adds specs for both types of Ranges in 1). There weren't any for the Include matcher used with Ranges.
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 2) Adds specs for both types of Ranges in 1). There weren't any for the Include matcher used with Ranges.
Hi @pirj, thanks again for kicking off those builds for me! I've fixed up a couple issues causing a failing build and think this one should pass. In particular, I've now targeted ruby versions >= 2.1.9 for this improvement. Assuming CI passes, I'll update the docs to indicate these improvements are available for >= 2.1.9. How does that sound to you? |
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 2) Adds specs for both types of Ranges in 1). There weren't any for the Include matcher used with Ranges.
This comment was marked as off-topic.
This comment was marked as off-topic.
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 2) Adds specs for both types of Ranges in 1). There weren't any for the Include matcher used with Ranges.
Subject of the issue
include
breaks with a time rangeOriginally reported by @schwern in rubocop/rubocop-rspec#926
Your environment
master
(eb1787f
)Steps to reproduce
Expected behavior
All examples pass
Actual behavior
The example with a time range and
include
matcher fails with:The text was updated successfully, but these errors were encountered: