summaryrefslogtreecommitdiff
path: root/spec/rubyspec/library/date/upto_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubyspec/library/date/upto_spec.rb')
-rw-r--r--spec/rubyspec/library/date/upto_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/rubyspec/library/date/upto_spec.rb b/spec/rubyspec/library/date/upto_spec.rb
new file mode 100644
index 0000000000..c99aabd1d7
--- /dev/null
+++ b/spec/rubyspec/library/date/upto_spec.rb
@@ -0,0 +1,16 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+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