summaryrefslogtreecommitdiff
path: root/spec/ruby/core/range/each_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/range/each_spec.rb')
-rw-r--r--spec/ruby/core/range/each_spec.rb34
1 files changed, 16 insertions, 18 deletions
diff --git a/spec/ruby/core/range/each_spec.rb b/spec/ruby/core/range/each_spec.rb
index 1dce9c1f1e..bd4bbb82e5 100644
--- a/spec/ruby/core/range/each_spec.rb
+++ b/spec/ruby/core/range/each_spec.rb
@@ -38,26 +38,24 @@ describe "Range#each" do
a.should == ["Σ", "Τ", "Υ", "Φ", "Χ", "Ψ", "Ω"]
end
- ruby_version_is "2.6" do
- it "works with endless ranges" do
- a = []
- eval("(-2..)").each { |x| break if x > 2; a << x }
- a.should == [-2, -1, 0, 1, 2]
-
- a = []
- eval("(-2...)").each { |x| break if x > 2; a << x }
- a.should == [-2, -1, 0, 1, 2]
- end
+ it "works with endless ranges" do
+ a = []
+ eval("(-2..)").each { |x| break if x > 2; a << x }
+ a.should == [-2, -1, 0, 1, 2]
+
+ a = []
+ eval("(-2...)").each { |x| break if x > 2; a << x }
+ a.should == [-2, -1, 0, 1, 2]
+ end
- it "works with String endless ranges" do
- a = []
- eval("('A'..)").each { |x| break if x > "D"; a << x }
- a.should == ["A", "B", "C", "D"]
+ it "works with String endless ranges" do
+ a = []
+ eval("('A'..)").each { |x| break if x > "D"; a << x }
+ a.should == ["A", "B", "C", "D"]
- a = []
- eval("('A'...)").each { |x| break if x > "D"; a << x }
- a.should == ["A", "B", "C", "D"]
- end
+ a = []
+ eval("('A'...)").each { |x| break if x > "D"; a << x }
+ a.should == ["A", "B", "C", "D"]
end
ruby_version_is "2.7" do