From 9a53dbc1b0c64c5469f5504a237d62b83da83367 Mon Sep 17 00:00:00 2001 From: David Bajger Date: Fri, 19 Jan 2024 18:05:12 +0100 Subject: [PATCH] Updated test for validation of GH repository names. --- ...eCreateFromRemoteRepoCliCommandTest.class.st | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/PharoLauncher-CLI-Tests/PhLImageCreateFromRemoteRepoCliCommandTest.class.st b/src/PharoLauncher-CLI-Tests/PhLImageCreateFromRemoteRepoCliCommandTest.class.st index 3aa6cd32..c8478110 100644 --- a/src/PharoLauncher-CLI-Tests/PhLImageCreateFromRemoteRepoCliCommandTest.class.st +++ b/src/PharoLauncher-CLI-Tests/PhLImageCreateFromRemoteRepoCliCommandTest.class.st @@ -75,14 +75,21 @@ PhLImageCreateFromRemoteRepoCliCommandTest >> testValidCreateFromRemoteRepoWithA { #category : #tests } PhLImageCreateFromRemoteRepoCliCommandTest >> testValidateRepoFullName [ - | commandSpec validRepoNames | + | commandSpec validRepoNames invalidRepoName createCommand | commandSpec := PhLImageCreateFromRemoteRepoCliCommand asCliCommand. validRepoNames := #('owner/project' 'owner/project:branch' 'owner/some-project:feature/branch-name' 'owner/project:v1' 'owner/project:v1.1' 'owner/project:v1.1a' 'owner/project:V1.1.1a' 'owner/project:1.0-RC-somecomment'). validRepoNames do: [:repoName | - |createCommand| - createCommand := (commandSpec activationWith: { 'fromRepo'. repoName. } asArray) command. - createCommand validateRepoFullName - ] + createCommand := (commandSpec activationWith: { 'fromRepo'. repoName }) command. + self + assert: createCommand isValidRepoFullName + description: 'Valid repository name not validated: ', repoName. + ]. + + invalidRepoName := 'owner/project:'. + createCommand := (commandSpec activationWith: { 'fromRepo'. invalidRepoName }) command. + self + deny: createCommand isValidRepoFullName + description: 'Invalid repository name validated: ', invalidRepoName. ]