test/test_times.rb in richunits-0.2.0 vs test/test_times.rb in richunits-0.5.0

- old
+ new

@@ -1,6 +1,6 @@ -require 'rich_units/times.rb' +require 'richunits/times' require 'test/unit' class TC_Times < Test::Unit::TestCase #def test_micro_seconds @@ -10,39 +10,40 @@ #def test_milli_seconds # assert_equal( 0.001, 1.millisecond ) #end def test_seconds - assert_equal( 60**0, 1.seconds ) + assert_equal( 60**0, 1.seconds.to_i ) end def test_minutes - assert_equal( 60**1, 1.minutes ) + assert_equal( 60**1, 1.minutes.to_i ) end def test_hours - assert_equal( 60**2, 1.hours ) + assert_equal( 60**2, 1.hours.to_i ) end def test_days - assert_equal( 24*(60**2), 1.days ) + assert_equal( 24*(60**2), 1.days.to_i ) end def test_weeks - assert_equal( 7*24*(60**2), 1.weeks ) + assert_equal( 7*24*(60**2), 1.weeks.to_i ) end def test_fortnights - assert_equal( 14*24*(60**2), 1.fortnights ) + assert_equal( 14*24*(60**2), 1.fortnights.to_i ) end def test_months - assert_equal( 30*24*(60**2), 1.months ) + assert_equal( 30*24*(60**2), 1.months.to_i ) end def test_years - assert_equal( 365*24*(60**2), 1.years ) + assert_equal( 365*24*(60**2), 1.years.to_i ) end + def test_before t = Time.now assert_equal( t - 1.day, 1.day.before(t) ) end