Open rnapier opened 10 years ago
Using IntelliJ 15 and Goplugin 0.10.1137 I can run Ginkgo-tests using the Go-plugin out of the box using ctrl+shift+r provided I have the snippet bridging go test and ginkgo in the file:
func TestGinkgo(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Some Test Suite Name")
}
Complete Ginkgo-test:
package main_test
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"testing"
)
func TestGinkgo(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Demo Suite")
}
var _ = Describe("Running tests with Ginkgo", func() {
It("can succeed", func() {
Expect(true).To(BeTrue())
})
It("can fail", func() {
Expect(false).To(BeTrue())
})
})
Running the test looks like this:
However there are some limitations:
Ginkgo tests do not appear in the test browser, and failures show up as success. Even though the output ends with:
the test browser shows a green "OK". This was run as:
(it's possible there is a deeper test runner problem here, since it should detect success/failure in any case.)
If it is helpful, Ginkgo will spit out a junit.xml file, which might be easier to handle than its own output.
IDEA: 13.1 CE OS: OS X 10.9 (also Win7) JDK: 1.6.0