Sha256: c6622b8f3de07ec352697a1e5d8792c87dc0171a3df9598468409dbc12902b81
Contents?: true
Size: 678 Bytes
Versions: 9
Compression:
Stored size: 678 Bytes
Contents
require "spec_helper" require "active_support/core_ext/numeric/time" describe Pliny::Helpers::ZuluTime do context "zulu_time" do class ZuluTimeTest extend Pliny::Helpers::ZuluTime end it "it formats Time instances" do formatted = ZuluTimeTest.zulu_time(Time.parse("2017-11-28T21:49:52.123+00:00")) assert_equal "2017-11-28T21:49:52Z", formatted end it "it formats DateTime instances" do formatted = ZuluTimeTest.zulu_time(DateTime.parse("2017-11-28T21:49:52.123+00:00")) assert_equal "2017-11-28T21:49:52Z", formatted end it "when called with nil" do assert_nil ZuluTimeTest.zulu_time(nil) end end end
Version data entries
9 entries across 9 versions & 1 rubygems