PageRenderTime 26ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/gems/facets-2.4.5/test/core/time/test_stamp.rb

https://bitbucket.org/mediashelf/fedora-migrator
Ruby | 28 lines | 15 code | 8 blank | 5 comment | 0 complexity | dc6c9e1892837acb8c801486566b470d MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
  1. require 'facets/time.rb'
  2. require 'test/unit'
  3. require 'time'
  4. class TC_Time_Stamp < Test::Unit::TestCase
  5. def setup
  6. end
  7. # TODO Problem with TIMEZONE.
  8. #def test_stamp_01
  9. # t = Time.parse('4/20/2005 15:37')
  10. # assert_equal( "Wed Apr 20 15:37:00 PDT 2005", t.stamp )
  11. #end
  12. def test_stamp_02
  13. t = Time.parse('4/20/2005 15:37')
  14. assert_equal( "April 20, 2005 15:37", t.stamp(:long) )
  15. end
  16. def test_stamp_03
  17. t = Time.parse('4/20/2005 15:37')
  18. assert_equal( "20 Apr 15:37", t.stamp(:short) )
  19. end
  20. end