From fa5224bdada67f872c94bf497a19ffef6f25a64b Mon Sep 17 00:00:00 2001 From: MaximilianoTabacman Date: Fri, 5 Jan 2024 11:55:57 -0300 Subject: [PATCH] Corrected test assertion to prevent assuming order of results --- source/Sagan-Core-Tests/RepositoryBasedTest.class.st | 8 ++++++-- source/Sagan-GemStone/GemStoneRepository.class.st | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/source/Sagan-Core-Tests/RepositoryBasedTest.class.st b/source/Sagan-Core-Tests/RepositoryBasedTest.class.st index fc3c3ff..3f1b539 100644 --- a/source/Sagan-Core-Tests/RepositoryBasedTest.class.st +++ b/source/Sagan-Core-Tests/RepositoryBasedTest.class.st @@ -24,8 +24,12 @@ RepositoryBasedTest class >> isAbstract [ RepositoryBasedTest >> assertRepositoryIncludesSilvesterStallone [ self extraterrestrials - withOneMatching: [ :extraterrestrial | extraterrestrial firstName = 'Silvester' ] - do: [ :extraterrestrial | self assert: extraterrestrial lastName equals: 'Stallone' ] + withOneMatching: [ :extraterrestrial | + extraterrestrial firstName = 'Silvester' and: [ extraterrestrial lastName = 'Stallone' ] ] + do: [ :extraterrestrial | + self assert: + ( extraterrestrial firstName = 'Silvester' and: [ extraterrestrial lastName = 'Stallone' ] ) + ] else: [ self fail ] ] diff --git a/source/Sagan-GemStone/GemStoneRepository.class.st b/source/Sagan-GemStone/GemStoneRepository.class.st index 0542476..c304bc7 100644 --- a/source/Sagan-GemStone/GemStoneRepository.class.st +++ b/source/Sagan-GemStone/GemStoneRepository.class.st @@ -66,7 +66,7 @@ GemStoneRepository >> findAllMatching: aCriteriaOrBlock sortedBy: aSortFunction GemStoneRepository >> initializeCheckingConflictsAccordingTo: aConflictCheckingStrategy [ conflictCheckingStrategy := aConflictCheckingStrategy. - contents := OrderedCollection new + contents := Bag new ] { #category : 'private - accessing' }