Sha256: 5233f3856b48dd2447392c0369787e1bbb1a65aaba0ac377dd5a4958f6fc81fb

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/more/times.rb
#
# Extracted Wed Aug 23 18:22:52 EDT 2006
# Unit Tools Reap Test Extractor
#

require 'facets/more/times.rb'


require 'test/unit'
#require 'mega/multiplier'

class TC_Numeric < Test::Unit::TestCase

  #def test_micro_seconds
  #  assert_equal( 0.000001, 1.microsecond )
  #end

  #def test_milli_seconds
  #  assert_equal( 0.001, 1.millisecond )
  #end

  def test_seconds
    assert_equal( 60**0, 1.seconds )
  end

  def test_minutes
    assert_equal( 60**1, 1.minutes )
  end

  def test_hours
    assert_equal( 60**2, 1.hours )
  end

  def test_days
    assert_equal( 24*(60**2), 1.days )
  end

  def test_weeks
    assert_equal( 7*24*(60**2), 1.weeks )
  end

  def test_fortnights
    assert_equal( 14*24*(60**2), 1.fortnights )
  end

  def test_months
    assert_equal( 30*24*(60**2), 1.months )
  end

  def test_years
    assert_equal( 365*24*(60**2), 1.years )
  end

  def test_before
    t = Time.now
    assert_equal( t - 1.day, 1.day.before(t) )
  end

  def test_after
    t = Time.now
    assert_equal( t + 1.day, 1.day.after(t) )
  end

end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.7.30 test/lib/facets/more/test_times.rb