mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@b65d01f
This commit is contained in:
parent
15d05f8120
commit
6998d75824
186 changed files with 3956 additions and 3339 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue