diff options
Diffstat (limited to 'spec/ruby/library/date/prev_day_spec.rb')
| -rw-r--r-- | spec/ruby/library/date/prev_day_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/ruby/library/date/prev_day_spec.rb b/spec/ruby/library/date/prev_day_spec.rb new file mode 100644 index 0000000000..cce24da875 --- /dev/null +++ b/spec/ruby/library/date/prev_day_spec.rb @@ -0,0 +1,14 @@ +require_relative '../../spec_helper' +require 'date' + +describe "Date#prev_day" do + it "returns previous day" do + d = Date.new(2000, 7, 2).prev_day + d.should == Date.new(2000, 7, 1) + end + + it "returns three days ago across months" do + d = Date.new(2000, 7, 2).prev_day(3) + d.should == Date.new(2000, 6, 29) + end +end |
