Last active
April 5, 2016 16:30
-
-
Save jochasinga/1db67ea64d76f8f0706374adb2120a57 to your computer and use it in GitHub Desktop.
Simple test example in Goconvey
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"testing" | |
. "github.com/smartystreets/goconvey/convey" | |
) | |
func IncrementInt(i int) int { | |
return i + 1 | |
} | |
func MyTest(t *testing.T) { | |
Convey("GIVEN the value of `a` is 3", t, func() { | |
a := 3 | |
Convey("WITH `IncrementInt(a)`", func() { | |
result := IncrementInt(a) | |
Convey("EXPECT `a` to be incremented by 1", func() { | |
So(result, ShouldEqual, 4) | |
}) | |
}) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment