Skip to content

Commit

Permalink
Merge pull request #96 from SeasideSt/95-GRIntervalTest--testSorted-a…
Browse files Browse the repository at this point in the history
…ssumes-new-collection

95 Don't assume Interval >> #sorted returns a new object
  • Loading branch information
jbrichau authored Aug 29, 2019
2 parents 7bf975a + a3105c7 commit 7b7648b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
asserting
assert: responseCollection validSequencedResponseFrom: receiverCollection
"Assert that the returned object is of a valid response class for the tested collection."

self assert: (self isValidNewSequencedResponseClass: responseCollection class)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
tests
testSorted
"Unlike super implementation do not assume Interval >> #sorted returns a new object"
| sorted collection |
collection := self arbitraryCollection.
sorted := collection sorted.
self assert: sorted validSequencedResponseFrom: collection.
self assert: sorted sortedWith: [ :a :b | a <= b ].

sorted := collection sorted: [ :a :b | a > b ].
self assert: sorted validSequencedNewResponseFrom: collection.
self assert: sorted sortedWith: [ :a :b | a > b ]

0 comments on commit 7b7648b

Please sign in to comment.