Skip to content

Commit

Permalink
Fix test for lowercase error
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Sep 22, 2023
1 parent b102982 commit ab72021
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion commands/fetch_templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func moveTemplates(repoPath string, overwrite bool) ([]string, []string, error)
func pullTemplate(repository string) error {
if _, err := os.Stat(repository); err != nil {
if !versioncontrol.IsGitRemote(repository) && !versioncontrol.IsPinnedGitRemote(repository) {
return fmt.Errorf("repository URL must be a valid git repo uri")
return fmt.Errorf("the repository URL must be a valid git repo uri")
}
}

Expand Down
6 changes: 4 additions & 2 deletions commands/template_pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ func Test_templatePull(t *testing.T) {
t.Run("InvalidUrlError", func(t *testing.T) {
faasCmd.SetArgs([]string{"template", "pull", "[email protected]:openfaas/faas-cli.git"})
err := faasCmd.Execute()
if !strings.Contains(err.Error(), "The repository URL must be a valid git repo uri") {
t.Errorf("Output does not contain the required error: %s", err.Error())
want := "the repository URL must be a valid git repo uri"
got := err.Error()
if !strings.Contains(err.Error(), want) {
t.Errorf("The error should contain:\n%q\n, but was:\n%q", want, got)
}
})
}
Expand Down

0 comments on commit ab72021

Please sign in to comment.