aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml1
-rw-r--r--README.md2
-rw-r--r--bool_test.go10
-rw-r--r--flag_test.go4
4 files changed, 9 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..4f2ee4d
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1 @@
+language: go
diff --git a/README.md b/README.md
index a12d94d..d9b189f 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,5 @@
+[![Build Status](https://travis-ci.org/ogier/pflag.png?branch=master)](https://travis-ci.org/ogier/pflag)
+
## Description
pflag is a drop-in replacement for Go's flag package, implementing
diff --git a/bool_test.go b/bool_test.go
index 2073590..a2e1c5d 100644
--- a/bool_test.go
+++ b/bool_test.go
@@ -2,14 +2,13 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package pflag_test
+package pflag
import (
+ "bytes"
"fmt"
"strconv"
"testing"
-
- . "github.com/spf13/pflag"
)
// This value can be a boolean ("true", "false") or "maybe"
@@ -156,8 +155,9 @@ func TestImplicitFalse(t *testing.T) {
func TestInvalidValue(t *testing.T) {
var tristate triStateValue
f := setUpFlagSet(&tristate)
- args := []string{"--tristate=invalid"}
- _, err := parseReturnStderr(t, f, args)
+ var buf bytes.Buffer
+ f.SetOutput(&buf)
+ err := f.Parse([]string{"--tristate=invalid"})
if err == nil {
t.Fatal("expected an error but did not get any, tristate has value", tristate)
}
diff --git a/flag_test.go b/flag_test.go
index f552a2f..7d114b2 100644
--- a/flag_test.go
+++ b/flag_test.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package pflag_test
+package pflag
import (
"bytes"
@@ -14,8 +14,6 @@ import (
"strings"
"testing"
"time"
-
- . "github.com/spf13/pflag"
)
var (