Sha256: 2f9c226d574069b1966ca37351ea362cad5cd79c9edb3799d9aba04eda29a411

Contents?: true

Size: 634 Bytes

Versions: 4

Compression:

Stored size: 634 Bytes

Contents

require 'test_helper'

class Superstore::Types::TimeTypeTest < Superstore::Types::TestCase
  test 'encode' do
    assert_equal '2004-12-24T01:02:03.000000Z', coder.encode(Time.utc(2004, 12, 24, 1, 2, 3))
  end

  test 'decode' do
    assert_nil coder.decode(nil)
    assert_nil coder.decode('bad format')
    assert_equal Time.utc(2004, 12, 24, 1, 2, 3), coder.decode('2004-12-24T01:02:03.000000Z')

    Time.use_zone 'Central Time (US & Canada)' do
      with_zone = coder.decode('2013-07-18 13:12:46 -0700')
      assert_equal Time.utc(2013, 07, 18, 20, 12, 46), with_zone
      assert_equal 'CDT', with_zone.zone
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
superstore-1.0.4 test/unit/types/time_type_test.rb
superstore-1.0.3 test/unit/types/time_type_test.rb
superstore-1.0.2 test/unit/types/time_type_test.rb
superstore-1.0.0 test/unit/types/time_type_test.rb