Open pirj opened 4 years ago
It breaks on Float as well.
require 'rspec'
describe 'include' do
it 'is not equivalent' do
obj = 2.5
range = (obj...obj)
expect(range.include?(obj)).to be_falsey # pass
expect(range).not_to include(obj) # TypeError: can't iterate from Float
end
end
Hi @pirj, @schwern, @JonRowe! I just put out a PR that attempts to address this issue. Would one of you mind giving it a review when you get a chance?
@bclayman-sq Certainly. We're always watching. 👀
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?
Bump.
Subject of the issue
include
breaks with a time rangeOriginally reported by @schwern in https://github.com/rubocop-hq/rubocop-rspec/issues/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: