class TimeExtMarshalingTest

Public Instance Methods

test_last_quarter_on_31st() click to toggle source
# File activesupport/test/core_ext/time_ext_test.rb, line 996
def test_last_quarter_on_31st
  assert_equal Time.local(2004, 2, 29), Time.local(2004, 5, 31).last_quarter
end
test_marshaling_with_frozen_local_instance() click to toggle source
# File activesupport/test/core_ext/time_ext_test.rb, line 982
def test_marshaling_with_frozen_local_instance
  t = Time.local(2000).freeze
  unmarshaled = Marshal.load(Marshal.dump(t))
  assert_equal t.zone, unmarshaled.zone
  assert_equal t, unmarshaled
end
test_marshaling_with_frozen_utc_instance() click to toggle source
# File activesupport/test/core_ext/time_ext_test.rb, line 975
def test_marshaling_with_frozen_utc_instance
  t = Time.utc(2000).freeze
  unmarshaled = Marshal.load(Marshal.dump(t))
  assert_equal "UTC", unmarshaled.zone
  assert_equal t, unmarshaled
end
test_marshaling_with_local_instance() click to toggle source
# File activesupport/test/core_ext/time_ext_test.rb, line 968
def test_marshaling_with_local_instance
  t = Time.local(2000)
  unmarshaled = Marshal.load(Marshal.dump(t))
  assert_equal t.zone, unmarshaled.zone
  assert_equal t, unmarshaled
end
test_marshaling_with_utc_instance() click to toggle source
# File activesupport/test/core_ext/time_ext_test.rb, line 961
def test_marshaling_with_utc_instance
  t = Time.utc(2000)
  unmarshaled = Marshal.load(Marshal.dump(t))
  assert_equal "UTC", unmarshaled.zone
  assert_equal t, unmarshaled
end
test_marshalling_preserves_fractional_seconds() click to toggle source
# File activesupport/test/core_ext/time_ext_test.rb, line 989
def test_marshalling_preserves_fractional_seconds
  t = Time.parse("00:00:00.500")
  unmarshaled = Marshal.load(Marshal.dump(t))
  assert_equal t.to_f, unmarshaled.to_f
  assert_equal t, unmarshaled
end