commit
0b1b85413e
@ -46,13 +46,15 @@ func CmdAddWithResult(cniNetns, cniIfname string, conf []byte, f func() error) (
|
|||||||
os.Stdout = w
|
os.Stdout = w
|
||||||
err = f()
|
err = f()
|
||||||
w.Close()
|
w.Close()
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// parse the result
|
var out []byte
|
||||||
out, err := ioutil.ReadAll(r)
|
if err == nil {
|
||||||
|
out, err = ioutil.ReadAll(r)
|
||||||
|
}
|
||||||
os.Stdout = oldStdout
|
os.Stdout = oldStdout
|
||||||
|
|
||||||
|
// Return errors after restoring stdout so Ginkgo will correctly
|
||||||
|
// emit verbose error information on stdout
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestTypes010(t *testing.T) {
|
func TestTypesCurrent(t *testing.T) {
|
||||||
RegisterFailHandler(Fail)
|
RegisterFailHandler(Fail)
|
||||||
RunSpecs(t, "0.3.0 Types Suite")
|
RunSpecs(t, "Current Types Suite")
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ func testResult() *current.Result {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = Describe("Ensures compatibility with the 0.3.0 spec", func() {
|
var _ = Describe("Current types operations", func() {
|
||||||
It("correctly encodes a 0.3.0 Result", func() {
|
It("correctly encodes a 0.3.0 Result", func() {
|
||||||
res := testResult()
|
res := testResult()
|
||||||
|
|
||||||
@ -150,7 +150,6 @@ var _ = Describe("Ensures compatibility with the 0.3.0 spec", func() {
|
|||||||
}`))
|
}`))
|
||||||
})
|
})
|
||||||
|
|
||||||
var _ = Describe("Ensures compatibility with the 0.1.0 spec", func() {
|
|
||||||
It("correctly encodes a 0.1.0 Result", func() {
|
It("correctly encodes a 0.1.0 Result", func() {
|
||||||
res, err := testResult().GetAsVersion("0.1.0")
|
res, err := testResult().GetAsVersion("0.1.0")
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
@ -211,4 +210,3 @@ var _ = Describe("Ensures compatibility with the 0.3.0 spec", func() {
|
|||||||
}`))
|
}`))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user