You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The reason will be displayed to describe this comment to others. Learn more.
@scottmessinger Yeah, it's ruby itself. In 1.9 hash iteration order is now based on insertion order. But with 1.8 it's not guaranteed and it was kind of a fluke that this was working.
If instead you did: "Array.to_mongo({'1' => '2', '3' => '4', '5' => '6', '7' => '8'}).should == [['1', '2'], ['3', '4'], ['5', '6'], ['7', '8']]" then the test breaks on 1.8 but passes on 1.9
4558dd4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this? This seems like a bug.
4558dd4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scottmessinger it's an issue with Ruby itself. The order of a Hash is not guaranteed.
4558dd4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scottmessinger Yeah, it's ruby itself. In 1.9 hash iteration order is now based on insertion order. But with 1.8 it's not guaranteed and it was kind of a fluke that this was working.
If instead you did: "Array.to_mongo({'1' => '2', '3' => '4', '5' => '6', '7' => '8'}).should == [['1', '2'], ['3', '4'], ['5', '6'], ['7', '8']]" then the test breaks on 1.8 but passes on 1.9
4558dd4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the info. Good to know!