Created
October 11, 2019 00:39
-
-
Save cbron/1c33866c516c283b4bf889bdc9bebc26 to your computer and use it in GitHub Desktop.
Base spec test
This file contains 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
package integration | |
import ( | |
"fmt" | |
"testing" | |
"github.com/sclevine/spec" | |
"github.com/sclevine/spec/report" | |
) | |
func TestObject(t *testing.T) { | |
spec.Run(t, "object", func(t *testing.T, when spec.G, it spec.S) { | |
it.Before(func() { | |
fmt.Println("Before") | |
}) | |
it.After(func() { | |
fmt.Println("After") | |
}) | |
when("when", func() { | |
it("it-a", func() { | |
fmt.Println("it-a") | |
}) | |
it("it-b", func() { | |
fmt.Println("it-b") | |
}) | |
}, spec.Flat()) | |
}, spec.Report(report.Terminal{})) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment