diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-28 09:19:59 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-28 09:19:59 +0000 |
commit | 52d2636f3e7658f76136310359c2ba00e613d2bd (patch) | |
tree | 523a193924876ba20fe00debc3f45765fb21bd79 /spec/ruby/library/date/prev_day_spec.rb | |
parent | c555bd7f01c531af8d33ed494b278a765381afd9 (diff) |
Update to ruby/spec@691755d
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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..8a42824154 --- /dev/null +++ b/spec/ruby/library/date/prev_day_spec.rb @@ -0,0 +1,14 @@ +require File.expand_path('../../../spec_helper', __FILE__) +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" do + d = Date.new(2000, 7, 4).prev_day(3) + d.should == Date.new(2000, 7, 1) + end +end |