diff options
Diffstat (limited to 'spec/ruby/core/array/slice_spec.rb')
-rw-r--r-- | spec/ruby/core/array/slice_spec.rb | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/spec/ruby/core/array/slice_spec.rb b/spec/ruby/core/array/slice_spec.rb index 8c276f9084..8e1499855a 100644 --- a/spec/ruby/core/array/slice_spec.rb +++ b/spec/ruby/core/array/slice_spec.rb @@ -172,16 +172,14 @@ describe "Array#slice!" do a.should == [1, 2] end - ruby_version_is "2.7" do - it "works with beginless ranges" do - a = [0,1,2,3,4] - a.slice!(eval("(..3)")).should == [0, 1, 2, 3] - a.should == [4] - - a = [0,1,2,3,4] - a.slice!(eval("(...-2)")).should == [0, 1, 2] - a.should == [3, 4] - end + it "works with beginless ranges" do + a = [0,1,2,3,4] + a.slice!((..3)).should == [0, 1, 2, 3] + a.should == [4] + + a = [0,1,2,3,4] + a.slice!((...-2)).should == [0, 1, 2] + a.should == [3, 4] end describe "with a subclass of Array" do |