Improve some assertions to have better logs in the CI in case of failure.
MODIFY
src/PharoLauncher-Tests-Commands/PhLCreateTemplateFromImageCommandTest.class.st
src/PharoLauncher-Tests-Commands/PhLCreateTemplateFromImageCommandTest.class.st
@@ -24,18 +24,14 @@ PhLCreateTemplateFromImageCommandTest >> testCanCreateATemplateAndRemoveImageWhe
selectImageAt: 1;
requestAnswer: 'TestTemplate'.
- self assert: presenter templateRepository localTemplates isEmpty.
+ self assertEmpty: presenter templateRepository localTemplates.
self assert: (presenter imageRepository hasImageNamed: 'TestImage').
command execute.
templates := presenter templateRepository localTemplateNames.
- self
- assert: templates size
- equals: 1.
- self
- assertCollection: templates
- hasSameElements: #('TestTemplate').
- self deny: (presenter imageRepository hasImageNamed: 'TestImage').
+ self assert: templates size equals: 1.
+ self assertCollection: templates hasSameElements: #('TestTemplate').
+ self deny: (presenter imageRepository hasImageNamed: 'TestImage')
]
{ #category : #tests }
@@ -47,14 +43,10 @@ PhLCreateTemplateFromImageCommandTest >> testCanCreateATemplateWhenSingleImageSe
selectImageAt: 1;
requestAnswer: 'TestTemplate'.
- self assert: presenter templateRepository localTemplates isEmpty.
+ self assertEmpty: presenter templateRepository localTemplates.
command execute.
templates := presenter templateRepository localTemplateNames.
- self
- assert: templates size
- equals: 1.
- self
- assertCollection: templates
- hasSameElements: #('TestTemplate').
+ self assert: templates size equals: 1.
+ self assertCollection: templates hasSameElements: #('TestTemplate')
]

MODIFY
src/PharoLauncher-Tests-Commands/PhLDeleteImageCommandTest.class.st
src/PharoLauncher-Tests-Commands/PhLDeleteImageCommandTest.class.st
@@ -48,6 +48,6 @@ PhLDeleteImageCommandTest >> testImagesPresenterIsRefreshedWhenImageDeleted [
images := command imagesPresenter imageNames.
self
- assert: images isEmpty;
- assert: (presenter imageLabel beginsWith: 'No image selected').
+ assertEmpty: images;
+ assert: (presenter imageLabel beginsWith: 'No image selected')
]

MODIFY
src/PharoLauncher-Tests-Commands/PhLRemoveTemplateCommandTest.class.st
src/PharoLauncher-Tests-Commands/PhLRemoveTemplateCommandTest.class.st
@@ -34,11 +34,9 @@ PhLRemoveTemplateCommandTest >> testCanRemoveALocalTemplate [
command execute.
- self
- assertCollection: presenter templateNames
- hasSameElements: #().
+ self assertCollection: presenter templateNames hasSameElements: #().
- self assert: presenter templateRoots isEmpty.
+ self assertEmpty: presenter templateRoots
]
{ #category : #tests }

MODIFY
src/PharoLauncher-Tests-Core/PhLDirectoryBasedImageRepositoryTest.class.st
src/PharoLauncher-Tests-Core/PhLDirectoryBasedImageRepositoryTest.class.st
@@ -44,23 +44,23 @@ PhLDirectoryBasedImageRepositoryTest >> testDeleteImageNamed [
group := self newGroupWithAnImage.
self assert: group imageNames asSet equals: #('test') asSet.
group deleteImageNamed: 'test'.
- self assert: group imageNames isEmpty
+ self assertEmpty: group imageNames
]
{ #category : #'instance-creation' }
PhLDirectoryBasedImageRepositoryTest >> testDirectoryForImageNamed [
| group |
group := self emptyGroup.
- self assert: group images isEmpty.
- self assert: group imageNames isEmpty.
+ self assertEmpty: group images.
+ self assertEmpty: group imageNames
]
{ #category : #'instance-creation' }
PhLDirectoryBasedImageRepositoryTest >> testEmptyByDefault [
| group |
group := self emptyGroup.
- self assert: group images isEmpty.
- self assert: group imageNames isEmpty.
+ self assertEmpty: group images.
+ self assertEmpty: group imageNames
]
{ #category : #'instance-creation' }

MODIFY
src/PharoLauncher-Tests-Core/PhLTemplateSourcesTest.class.st
src/PharoLauncher-Tests-Core/PhLTemplateSourcesTest.class.st
@@ -24,8 +24,7 @@ PhLTemplateSourcesTest >> testAlmostIdenticalTemplateSourcesAreDifferent [
templatesSources2 := (PhLPharoTemplateSources withTemplateList: PhLPharoTemplateSources defaultSources) sources.
templatesSources2 second templates first name: 'changed'.
- self deny: templatesSources1 = templatesSources2
-
+ self deny: templatesSources1 equals: templatesSources2
]
{ #category : #tests }
@@ -57,31 +56,27 @@ PhLTemplateSourcesTest >> testGivenUserSourcesFileAbsentWhenAskingUserSourcesThe
sources := (PhLUserTemplateSources withFile: sourcesFile) sources.
- self assert: sources isEmpty
+ self assertEmpty: sources
]
{ #category : #tests }
PhLTemplateSourcesTest >> testGivenUserSourcesFileWithErrorsWhenAskingUserSourcesThenGetEmptyCollection [
| sources |
- sourcesFile
- writeStreamDo: [ :stream | stream nextPutAll: 'foobar' ].
+ sourcesFile writeStreamDo: [ :stream | stream nextPutAll: 'foobar' ].
sources := (PhLTemplateSources withFile: sourcesFile) sources.
- self assert: sources isEmpty
+ self assertEmpty: sources
]
{ #category : #tests }
PhLTemplateSourcesTest >> testGivenUserSourcesFileWithReferencesToUnknownVariablesWhenAskingUserSourcesThenGetEmptyCollection [
| sources |
- sourcesFile
- writeStreamDo: [ :stream | stream nextPutAll: '[PhLHTTPListingTemplateGroup{#nonexistingiv:''http://foo.org'',#name:''foo''}]' ].
+ sourcesFile writeStreamDo: [ :stream | stream nextPutAll: '[PhLHTTPListingTemplateGroup{#nonexistingiv:''http://foo.org'',#name:''foo''}]' ].
- self
- shouldnt:[ sources := (PhLTemplateSources withFile: sourcesFile) sources ]
- raise: InstanceVariableNotFound.
+ self shouldnt: [ sources := (PhLTemplateSources withFile: sourcesFile) sources ] raise: InstanceVariableNotFound.
- self assert: sources isEmpty
+ self assertEmpty: sources
]
{ #category : #tests }
@@ -99,26 +94,21 @@ PhLTemplateSourcesTest >> testIdenticalTemplateSourcesAreEquals [
{ #category : #tests }
PhLTemplateSourcesTest >> testNoUpdateAnnouncedWhenDownloadedSourcesIsSameAsSources [
| announcements sources |
-
sourcesFile writeStreamDo: [ :stream | stream nextPutAll: (STON toString: true) ].
announcements := OrderedCollection new.
ZnClientTest new
withServerDo: [ :server |
- server onRequestRespond: [ :request |
- ZnResponse ok: (ZnEntity text: (STON toString: true)) ].
+ server onRequestRespond: [ :request | ZnResponse ok: (ZnEntity text: (STON toString: true)) ].
sources := PhLPharoTemplateSources withFile: sourcesFile.
PhLPharoTemplateSources sourcesUrl: server localUrl.
- PhLPharoTemplateSources announcer weak
- when: PhLSourcesFileUpdateAvailable
- send: #add:
- to: announcements.
+ PhLPharoTemplateSources announcer weak when: PhLSourcesFileUpdateAvailable send: #add: to: announcements.
sources checkForUpdates.
- self assert: announcements isEmpty ].
+ self assertEmpty: announcements ]
]
{ #category : #tests }

MODIFY
src/PharoLauncher-Tests-Download/PhLJenkins2BuildTest.class.st
src/PharoLauncher-Tests-Download/PhLJenkins2BuildTest.class.st
@@ -93,7 +93,7 @@ PhLJenkins2BuildTest >> runUrlString [
PhLJenkins2BuildTest >> testBuildWithArtifacts [
| artifact |
self setUpResponse: self oneArtifactResponse.
- self assert: self emptyBuild runs isEmpty.
+ self assertEmpty: self emptyBuild runs.
self assert: self emptyBuild artifacts size equals: 1.
artifact := self emptyBuild artifacts first.
self assert: artifact relativePath equals: self artifactRelativePath.
@@ -104,7 +104,7 @@ PhLJenkins2BuildTest >> testBuildWithArtifacts [
PhLJenkins2BuildTest >> testBuildWithRuns [
| run |
self setUpResponse: self oneRunResponse.
- self assert: self emptyBuild artifacts isEmpty.
+ self assertEmpty: self emptyBuild artifacts.
self assert: self emptyBuild runs size equals: 1.
run := self emptyBuild runs first.
self assert: run number equals: self runNumber
@@ -113,8 +113,8 @@ PhLJenkins2BuildTest >> testBuildWithRuns [
{ #category : #tests }
PhLJenkins2BuildTest >> testEmptyBuild [
self setUpResponse: '{}'.
- self assert: self emptyBuild artifacts isEmpty.
- self assert:self emptyBuild runs isEmpty.
+ self assertEmpty: self emptyBuild artifacts.
+ self assertEmpty: self emptyBuild runs
]
{ #category : #tests }

MODIFY
src/PharoLauncher-Tests-Download/PhLJenkins2JobTest.class.st
src/PharoLauncher-Tests-Download/PhLJenkins2JobTest.class.st
@@ -108,7 +108,7 @@ PhLJenkins2JobTest >> pipelineResponse [
{ #category : #tests }
PhLJenkins2JobTest >> testJobWithNoSuccessfulBuild [
self setUpResponse: self noBuildsResponse.
- self assert: self newJobWithNoSuccessfulBuild builds isEmpty
+ self assertEmpty: self newJobWithNoSuccessfulBuild builds
]
{ #category : #tests }

MODIFY
src/PharoLauncher-Tests-Download/PhLJenkins2ServerTest.class.st
src/PharoLauncher-Tests-Download/PhLJenkins2ServerTest.class.st
@@ -55,7 +55,7 @@ PhLJenkins2ServerTest >> oneJobResponse [
{ #category : #tests }
PhLJenkins2ServerTest >> testNoJob [
self setUpResponse: self noJobsResponse.
- self assert: self newInstance jobs isEmpty
+ self assertEmpty: self newInstance jobs
]
{ #category : #tests }

MODIFY
src/PharoLauncher-Tests-Functional/PhLVirtualMachineManagerFunctionalTest.class.st
src/PharoLauncher-Tests-Functional/PhLVirtualMachineManagerFunctionalTest.class.st
@@ -44,7 +44,7 @@ PhLVirtualMachineManagerFunctionalTest >> testCanDetectPreSpurImage [
{ #category : #tests }
PhLVirtualMachineManagerFunctionalTest >> testCanDetectSystemUnzip [
- self assert: PhLVirtualMachineManager canUseSytemZip equals: true
+ self assert: PhLVirtualMachineManager canUseSytemZip
]
{ #category : #tests }

MODIFY
src/PharoLauncher-Tests-SpecUI/PhLLaunchConfigurationPresenterTest.class.st
src/PharoLauncher-Tests-SpecUI/PhLLaunchConfigurationPresenterTest.class.st
@@ -71,11 +71,9 @@ PhLLaunchConfigurationPresenterTest >> testConfigurationDetailIsCleanedWhenConfi
selectConfiguration: config;
clickDeleteConfigurationButton.
- self assert: presenter imageArguments isEmpty.
- self assert: presenter vmArguments isEmpty.
- self assert: presenter configurationName isEmpty.
-
-
+ self assertEmpty: presenter imageArguments.
+ self assertEmpty: presenter vmArguments.
+ self assertEmpty: presenter configurationName
]
{ #category : #tests }

Improve some assertions to have better logs in the CI in case of failure.