Sha256: 6912070ff136fd67eb4bb91b6a15f6bd20daf136ade847b9789bb4220d4a302c

Contents?: true

Size: 395 Bytes

Versions: 10

Compression:

Stored size: 395 Bytes

Contents

require_relative 'helper'

describe 'DateTimeParser' do
  it 'should handle ymd style values' do
    text   = "2011-12-31 09:01:02.80300899 +1100"
    time   = DateTime.parse(text)
    result = Swift::DateTime.parse(text)

    assert_equal time.strftime('%F %T %z'), result.strftime('%F %T %z')
    assert_equal time.second_fraction.to_f.round(8), result.second_fraction.to_f.round(8)
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
swift-1.2.3 test/test_datetime_parser.rb
swift-1.2.2 test/test_datetime_parser.rb
swift-1.2.1 test/test_datetime_parser.rb
swift-1.2.0 test/test_datetime_parser.rb
swift-1.1.0 test/test_datetime_parser.rb
swift-1.0.3 test/test_datetime_parser.rb
swift-1.0.2 test/test_datetime_parser.rb
swift-1.0.1 test/test_datetime_parser.rb
swift-1.0.0 test/test_datetime_parser.rb
swift-0.14.0 test/test_datetime_parser.rb