
Issue #19564 has been reported by PeteMichaud (Pete Michaud). ---------------------------------------- Bug #19564: Range.cover? fails for Range wrapped in SimpleDelegator https://bugs.ruby-lang.org/issues/19564 * Author: PeteMichaud (Pete Michaud) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- ```ruby 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 ``` -- https://bugs.ruby-lang.org/