Skip to content

Commit

Permalink
pass: skip test if pass not installed
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Aug 30, 2022
1 parent 203341b commit ba65f0e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pass/pass_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
package pass

import (
"os/exec"
"strings"
"testing"

"github.com/docker/docker-credential-helpers/credentials"
)

func TestPassHelper(t *testing.T) {
if _, err := exec.LookPath("pass"); err != nil {
t.Skip("test requires pass to be installed")
}

helper := Pass{}

creds := &credentials.Credentials{
Expand Down Expand Up @@ -75,6 +80,10 @@ func TestPassHelper(t *testing.T) {
}

func TestMissingCred(t *testing.T) {
if _, err := exec.LookPath("pass"); err != nil {
t.Skip("test requires pass to be installed")
}

helper := Pass{}

_, _, err := helper.Get("garbage")
Expand Down

0 comments on commit ba65f0e

Please sign in to comment.