Show
Ignore:
Timestamp:
12/28/07 09:25:18 (13 months ago)
Author:
walf443
Message:

lang/ruby/date_time-smart: added example.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/date_time-smart/spec/date_time-smart_spec.rb

    r3658 r3659  
    2323  it %{should subtract DateTime::Duration and return new object } do 
    2424    ( @birth_after_a_year_before_a_day - @dd ).should == @birth 
     25  end 
     26 
     27  it %{should add with DateTime::Duration.new2} do 
     28    @birth.add(:days => 364).should == @birth_after_a_year_before_a_day 
     29    @birth.add(:months => 11, :days => 30).should == @birth_after_a_year_before_a_day 
     30    @birth.add(:years => 1).subtract(:days => 1).should == @birth_after_a_year_before_a_day 
    2531  end 
    2632end