summaryrefslogtreecommitdiff
path: root/spec/ruby/core/array/values_at_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/array/values_at_spec.rb')
-rw-r--r--spec/ruby/core/array/values_at_spec.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/spec/ruby/core/array/values_at_spec.rb b/spec/ruby/core/array/values_at_spec.rb
index f1522e0bfe..e85bbee400 100644
--- a/spec/ruby/core/array/values_at_spec.rb
+++ b/spec/ruby/core/array/values_at_spec.rb
@@ -1,6 +1,7 @@
require_relative '../../spec_helper'
require_relative 'fixtures/classes'
+# Should be synchronized with core/struct/values_at_spec.rb
describe "Array#values_at" do
it "returns an array of elements at the indexes when passed indexes" do
[1, 2, 3, 4, 5].values_at().should == []
@@ -66,10 +67,8 @@ describe "Array#values_at" do
[1, 2, 3, 4].values_at(eval("(3...)")).should == [4]
end
- ruby_version_is "2.7" do
- it "works when given beginless ranges" do
- [1, 2, 3, 4].values_at(eval("(..2)")).should == [1, 2, 3]
- [1, 2, 3, 4].values_at(eval("(...2)")).should == [1, 2]
- end
+ it "works when given beginless ranges" do
+ [1, 2, 3, 4].values_at((..2)).should == [1, 2, 3]
+ [1, 2, 3, 4].values_at((...2)).should == [1, 2]
end
end