Skip to content

Commit

Permalink
Updated test for validation of GH repository names.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bajger committed Jan 19, 2024
1 parent 71a4665 commit 9a53dbc
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
]

0 comments on commit 9a53dbc

Please sign in to comment.