summaryrefslogtreecommitdiff
path: root/spec/ruby/library/date/upto_spec.rb
blob: 8745be85b3b091c5df712efc73e6d5ac9c3202db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require_relative '../../spec_helper'
require 'date'

describe "Date#upto" do
  it "returns future dates for the default step value" do
    ds    = Date.civil(2008, 10, 11)
    de    = Date.civil(2008,  9, 29)
    count = 0
    de.upto(ds) do |d|
      d.should <= ds
      d.should >= de
      count += 1
    end
    count.should == 13
  end
end