Created
December 10, 2012 09:42
-
-
Save kfatehi/4249617 to your computer and use it in GitHub Desktop.
Datetime difference in p327 v p193
This file contains 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
# in ruby19p193 (on mac) we get the expected behavior | |
[9] pry(#<RSpec::Core::ExampleGroup::Nested_1::Nested_2>)> right['created_at'] | |
=> Mon, 10 Dec 2012 09:32:21 UTC +00:00 | |
[10] pry(#<RSpec::Core::ExampleGroup::Nested_1::Nested_2>)> left['created_at'] | |
=> Mon, 10 Dec 2012 09:32:21 UTC +00:00 | |
[11] pry(#<RSpec::Core::ExampleGroup::Nested_1::Nested_2>)> right['created_at'] == left['created_at'] | |
=> true |
This file contains 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
# in ruby19p327 (on ubuntu) | |
# with right and left being two seemingly identical hashes: | |
[13] pry(#<RSpec::Core::ExampleGroup::Nested_1::Nested_2>)> right['created_at'] | |
=> Mon, 10 Dec 2012 09:35:56 UTC +00:00 | |
[14] pry(#<RSpec::Core::ExampleGroup::Nested_1::Nested_2>)> left['created_at'] | |
=> Mon, 10 Dec 2012 09:35:56 UTC +00:00 | |
[15] pry(#<RSpec::Core::ExampleGroup::Nested_1::Nested_2>)> right['created_at'] == left['created_at'] | |
=> false | |
# what? false? why? is it because of usecs? | |
[17] pry(#<RSpec::Core::ExampleGroup::Nested_1::Nested_2>)> left['created_at'].usec | |
=> 580168 | |
[18] pry(#<RSpec::Core::ExampleGroup::Nested_1::Nested_2>)> right['created_at'].usec | |
=> 580168 | |
02:44 love_col_: Radar: elaptics: for the record, i downgraded to p193, and i am still getting that issue, so it had nothing to do with the ruby version
02:44 love_col_: the only remaining variable is that one machine is ubuntu while the other is mac os x
02:44 love_col_: still confused, but i wanted to clear the air regarding my blaming of p327
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mystery solved:
[29] pry(#RSpec::Core::ExampleGroup::Nested_1::Nested_2)> right['created_at'].to_f
=> 1355132156.5801682
[30] pry(#RSpec::Core::ExampleGroup::Nested_1::Nested_2)> left['created_at'].to_f
=> 1355132156.580168