Ginkgo和tdd的一些总结

文章目录

  • Basic usage
  • Framework Structure
  • Coding skills

Basic usage

go get -u github.com/onsi/ginkgo/ginkgo
go get github.com/onsi/ginkgo/ginkgo
go get github.com/onsi/gomega/...
ginkgo bootstrap
ginkgo generate $test_case_name
go test -v ./...

Framework Structure

Describe
BeforeEach
Context
It
AfterEach

Coding skills

As simple as possible

Expect(expected).To(Equal(test_value))
Expect(func() {
				func("invalid_addr")
			}).To(Panic())
Expect(test_value).NotTo(BeNil())

你可能感兴趣的:(golang,学习笔记)