UseDefaultTag for skip build if not default branch.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2017-11-09 13:24:35 +08:00
parent c591da7e86
commit 5fa26ebb5f
5 changed files with 82 additions and 79 deletions

25
docker_test.go Normal file
View File

@@ -0,0 +1,25 @@
package docker
import "testing"
func Test_stripHeadPrefix(t *testing.T) {
type args struct {
ref string
}
tests := []struct {
args args
want string
}{
{
args: args{
ref: "refs/heads/master",
},
want: "master",
},
}
for _, tt := range tests {
if got := stripHeadPrefix(tt.args.ref); got != tt.want {
t.Errorf("stripHeadPrefix() = %v, want %v", got, tt.want)
}
}
}