summaryrefslogtreecommitdiff
path: root/spec/ruby/core/enumerator/arithmetic_sequence/end_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/enumerator/arithmetic_sequence/end_spec.rb')
-rw-r--r--spec/ruby/core/enumerator/arithmetic_sequence/end_spec.rb17
1 files changed, 11 insertions, 6 deletions
diff --git a/spec/ruby/core/enumerator/arithmetic_sequence/end_spec.rb b/spec/ruby/core/enumerator/arithmetic_sequence/end_spec.rb
index 5a436e8167..05429cac3e 100644
--- a/spec/ruby/core/enumerator/arithmetic_sequence/end_spec.rb
+++ b/spec/ruby/core/enumerator/arithmetic_sequence/end_spec.rb
@@ -1,11 +1,16 @@
require_relative '../../../spec_helper'
-ruby_version_is "2.6" do
- describe "Enumerator::ArithmeticSequence#end" do
- it "returns the end of the sequence" do
- 1.step(10).end.should == 10
- (1..10).step.end.should == 10
- (1...10).step(17).end.should == 10
+describe "Enumerator::ArithmeticSequence#end" do
+ it "returns the end of the sequence" do
+ 1.step(10).end.should == 10
+ (1..10).step.end.should == 10
+ (1...10).step(17).end.should == 10
+ end
+
+ context "with endless" do
+ it "returns nil as end of the sequence" do
+ (1..).step(1).end.should == nil
+ (1...).step(1).end.should == nil
end
end
end