Created
March 23, 2010 12:13
-
-
Save giom/341103 to your computer and use it in GitHub Desktop.
Strange bug with Marshaling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Time | |
attr_accessor :test | |
end | |
t = Time.now | |
mt = Marshal.dump [t,t] | |
Marshal.load(mt) == [t,t] #=> true | |
t.test = t - 31557600 | |
mt = Marshal.dump [t,t] | |
Marshal.load(mt) == [t,t] #=> false | |
Marshal.load(mt) == [t,t.test] #=> true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment