Created
November 12, 2009 11:05
-
-
Save Sixeight/232815 to your computer and use it in GitHub Desktop.
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
| Spec::Matchers.create :be_same_list do |other| | |
| match do |me| | |
| me.sort == other.sort | |
| end | |
| end | |
| [1, 2, 3, 4].should be_same_list([2, 1 ,4, 3]) | |
| [1, 2, 3, 4].should_not be_same_list([2, 4, 3]) | |
| # or | |
| def be_same_list(other) | |
| simple_match('same list') do |me| | |
| me.sort == other.sort | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment