summaryrefslogtreecommitdiff
path: root/spec/ruby/core/enumerator/arithmetic_sequence/last_spec.rb
blob: 31f982b7c4af33806d3f31438b6f5ad5e4e94e93 (plain)
1
2
3
4
5
6
7
8
9
require_relative '../../../spec_helper'

describe "Enumerator::ArithmeticSequence#last" do
  it "returns the last element of the sequence" do
    1.step(10).last.should == 10
    (1..10).step.last.should == 10
    (1...10).step(4).last.should == 9
  end
end