diff options
Diffstat (limited to 'spec/ruby/core/enumerator/arithmetic_sequence/first_spec.rb')
-rw-r--r-- | spec/ruby/core/enumerator/arithmetic_sequence/first_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/ruby/core/enumerator/arithmetic_sequence/first_spec.rb b/spec/ruby/core/enumerator/arithmetic_sequence/first_spec.rb new file mode 100644 index 0000000000..43c520d1f0 --- /dev/null +++ b/spec/ruby/core/enumerator/arithmetic_sequence/first_spec.rb @@ -0,0 +1,11 @@ +require_relative '../../../spec_helper' + +ruby_version_is "2.6" do + describe "Enumerator::ArithmeticSequence#first" do + it "returns the first element of the sequence" do + 1.step(10).first.should == 1 + (1..10).step.first.should == 1 + (1...10).step.first.should == 1 + end + end +end |