Skip to content

Commit

Permalink
Add some duration addition specs
Browse files Browse the repository at this point in the history
  • Loading branch information
jmettraux committed Jan 20, 2023
1 parent 510fa2d commit 4caa46d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/duration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,21 @@
end

[

[ '1Y1m17s', '2016-12-30 17:00:00', '2017-12-30 17:01:17' ],
[ '1Y1M17s', '2016-12-30 17:00:00', '2018-01-30 17:00:17' ],
[ '1M', '2016-02-02', '2016-03-02' ],

[ '-2M', '2016-02-02', '2015-12-02' ],
[ '-15M', '2016-02-02', '2014-11-02' ],

[ '-1Y1m17s', '2016-12-30 17:00:00', '2015-12-30 16:58:43' ],
[ '10M11m12s', '2016-03-01 16:48:48', '2017-01-01 17:00:00' ],
[ '-10M0m0s', '2016-12-30 17:00:00', '2016-03-01 17:00:00' ],
[ '-10M11m12s', '2016-12-30 17:00:00', '2016-03-01 16:48:48' ],
#
# 2016 is a bissextile year ;-)

].each do |d, t, tt|

it "adding #{t.inspect} to #{d.inspect} yields #{tt.inspect}" do
Expand Down

0 comments on commit 4caa46d

Please sign in to comment.