Actions
Bug #19564
closedRange.cover? fails for Range wrapped in SimpleDelegator
Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22]
Description
test 'built-in cover? method is broken for SimpleDelegator' do
class TimeRangeDelegator < SimpleDelegator
end
t1 = Time.now
t2 = t1+1.day
t3 = t1+1.week
r_long = t1..t3
r_short = t1..t2
assert r_long.cover?(r_short) #passes correctly, assert == true
r_long_delegated = TimeRangeDelegator.new(r_long)
r_short_delegated = TimeRangeDelegator.new(r_short)
assert r_long_delegated.cover?(r_short_delegated) #fails incorrectly, assert == false
end
Actions
Like0
Like0Like0Like0