summaryrefslogtreecommitdiff
path: root/spec/ruby/library/date/next_day_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/date/next_day_spec.rb')
-rw-r--r--spec/ruby/library/date/next_day_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/ruby/library/date/next_day_spec.rb b/spec/ruby/library/date/next_day_spec.rb
new file mode 100644
index 0000000000..3b066630e7
--- /dev/null
+++ b/spec/ruby/library/date/next_day_spec.rb
@@ -0,0 +1,14 @@
+require_relative '../../spec_helper'
+require 'date'
+
+describe "Date#next_day" do
+ it "returns the next day" do
+ d = Date.new(2000, 1, 4).next_day
+ d.should == Date.new(2000, 1, 5)
+ end
+
+ it "returns three days later across months" do
+ d = Date.new(2000, 1, 30).next_day(3)
+ d.should == Date.new(2000, 2, 2)
+ end
+end