diff options
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/time_ext_test.rb | 20 | ||||
-rw-r--r-- | activesupport/test/message_encryptor_test.rb | 2 | ||||
-rw-r--r-- | activesupport/test/message_verifier_test.rb | 2 |
3 files changed, 10 insertions, 14 deletions
diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb index 159b7d8366..c24c8619c6 100644 --- a/activesupport/test/core_ext/time_ext_test.rb +++ b/activesupport/test/core_ext/time_ext_test.rb @@ -758,33 +758,29 @@ end class TimeExtMarshalingTest < Test::Unit::TestCase def test_marshaling_with_utc_instance t = Time.utc(2000) - marshaled = Marshal.dump t - unmarshaled = Marshal.load marshaled - assert_equal t, unmarshaled + unmarshaled = Marshal.load(Marshal.dump(t)) assert_equal "UTC", unmarshaled.zone + assert_equal t, unmarshaled end def test_marshaling_with_local_instance t = Time.local(2000) - marshaled = Marshal.dump t - unmarshaled = Marshal.load marshaled - assert_equal t, unmarshaled + unmarshaled = Marshal.load(Marshal.dump(t)) assert_equal t.zone, unmarshaled.zone + assert_equal t, unmarshaled end def test_marshaling_with_frozen_utc_instance t = Time.utc(2000).freeze - marshaled = Marshal.dump t - unmarshaled = Marshal.load marshaled - assert_equal t, unmarshaled + unmarshaled = Marshal.load(Marshal.dump(t)) assert_equal "UTC", unmarshaled.zone + assert_equal t, unmarshaled end def test_marshaling_with_frozen_local_instance t = Time.local(2000).freeze - marshaled = Marshal.dump t - unmarshaled = Marshal.load marshaled - assert_equal t, unmarshaled + unmarshaled = Marshal.load(Marshal.dump(t)) assert_equal t.zone, unmarshaled.zone + assert_equal t, unmarshaled end end diff --git a/activesupport/test/message_encryptor_test.rb b/activesupport/test/message_encryptor_test.rb index 5c2b44f188..2fba62bdd6 100644 --- a/activesupport/test/message_encryptor_test.rb +++ b/activesupport/test/message_encryptor_test.rb @@ -4,7 +4,7 @@ require 'active_support/time' class MessageEncryptorTest < Test::Unit::TestCase def setup @encryptor = ActiveSupport::MessageEncryptor.new(ActiveSupport::SecureRandom.hex(64)) - @data = {:some=>"data", :now=>Time.now} + @data = { :some => "data", :now => Time.local(2010) } end def test_simple_round_tripping diff --git a/activesupport/test/message_verifier_test.rb b/activesupport/test/message_verifier_test.rb index 714a3b3a39..4821311244 100644 --- a/activesupport/test/message_verifier_test.rb +++ b/activesupport/test/message_verifier_test.rb @@ -12,7 +12,7 @@ require 'active_support/time' class MessageVerifierTest < Test::Unit::TestCase def setup @verifier = ActiveSupport::MessageVerifier.new("Hey, I'm a secret!") - @data = {:some=>"data", :now=>Time.now} + @data = { :some => "data", :now => Time.local(2010) } end def test_simple_round_tripping |