From 3580062fd38931e117cf41d989b65f7a36251e58 Mon Sep 17 00:00:00 2001 From: Southclaws Date: Sun, 11 Feb 2018 16:36:59 +0000 Subject: [PATCH] add: two more test cases --- pipeline/scoop/scoop_test.go | 84 ++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/pipeline/scoop/scoop_test.go b/pipeline/scoop/scoop_test.go index 6a7d1a972..4adc25685 100644 --- a/pipeline/scoop/scoop_test.go +++ b/pipeline/scoop/scoop_test.go @@ -106,6 +106,50 @@ func Test_doRun(t *testing.T) { }, false, }, + { + "valid", + args{ + &context.Context{ + Git: context.GitInfo{ + CurrentTag: "v1.0.1", + }, + Version: "1.0.1", + Artifacts: artifact.New(), + Config: config.Project{ + GitHubURLs: config.GitHubURLs{Download: "https://api.custom.github.enterprise.com"}, + Builds: []config.Build{ + {Binary: "test", Goarch: []string{"amd64"}, Goos: []string{"windows"}}, + }, + Dist: ".", + ProjectName: "run-pipe", + Archive: config.Archive{ + Format: "tar.gz", + }, + Release: config.Release{ + GitHub: config.Repo{ + Owner: "test", + Name: "test", + }, + }, + Scoop: config.Scoop{ + Bucket: config.Repo{ + Owner: "test", + Name: "test", + }, + Description: "A run pipe test formula", + Homepage: "https://github.com/goreleaser", + }, + }, + Publish: true, + }, + &DummyClient{}, + }, + []artifact.Artifact{ + {Name: "foo_1.0.1_windows_amd64.tar.gz", Goos: "windows", Goarch: "amd64"}, + {Name: "foo_1.0.1_windows_386.tar.gz", Goos: "windows", Goarch: "386"}, + }, + false, + }, { "no windows build", args{ @@ -267,6 +311,46 @@ func Test_doRun(t *testing.T) { }, true, }, + { + "no archive", + args{ + &context.Context{ + Git: context.GitInfo{ + CurrentTag: "v1.0.1", + }, + Version: "1.0.1", + Artifacts: artifact.New(), + Config: config.Project{ + Builds: []config.Build{ + {Binary: "test", Goarch: []string{"amd64"}, Goos: []string{"windows"}}, + }, + Dist: ".", + ProjectName: "run-pipe", + Archive: config.Archive{ + Format: "binary", + }, + Release: config.Release{ + Draft: true, + }, + Scoop: config.Scoop{ + Bucket: config.Repo{ + Owner: "test", + Name: "test", + }, + Description: "A run pipe test formula", + Homepage: "https://github.com/goreleaser", + }, + }, + Publish: true, + }, + &DummyClient{}, + }, + []artifact.Artifact{ + {Name: "foo_1.0.1_windows_amd64.tar.gz", Goos: "windows", Goarch: "amd64"}, + {Name: "foo_1.0.1_windows_386.tar.gz", Goos: "windows", Goarch: "386"}, + }, + true, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {