diff options
Diffstat (limited to 'spec/ruby/core/array/fill_spec.rb')
-rw-r--r-- | spec/ruby/core/array/fill_spec.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/spec/ruby/core/array/fill_spec.rb b/spec/ruby/core/array/fill_spec.rb index 8f0814a5da..bfa8db551b 100644 --- a/spec/ruby/core/array/fill_spec.rb +++ b/spec/ruby/core/array/fill_spec.rb @@ -316,13 +316,11 @@ describe "Array#fill with (filler, range)" do -> { [].fill('a', obj..obj) }.should raise_error(TypeError) end - ruby_version_is "2.6" do - it "works with endless ranges" do - [1, 2, 3, 4].fill('x', eval("(1..)")).should == [1, 'x', 'x', 'x'] - [1, 2, 3, 4].fill('x', eval("(3...)")).should == [1, 2, 3, 'x'] - [1, 2, 3, 4].fill(eval("(1..)")) { |x| x + 2 }.should == [1, 3, 4, 5] - [1, 2, 3, 4].fill(eval("(3...)")) { |x| x + 2 }.should == [1, 2, 3, 5] - end + it "works with endless ranges" do + [1, 2, 3, 4].fill('x', eval("(1..)")).should == [1, 'x', 'x', 'x'] + [1, 2, 3, 4].fill('x', eval("(3...)")).should == [1, 2, 3, 'x'] + [1, 2, 3, 4].fill(eval("(1..)")) { |x| x + 2 }.should == [1, 3, 4, 5] + [1, 2, 3, 4].fill(eval("(3...)")) { |x| x + 2 }.should == [1, 2, 3, 5] end ruby_version_is "2.7" do |