Skip to content

Instantly share code, notes, and snippets.

@markstgodard
Created March 21, 2019 02:02
Show Gist options
  • Save markstgodard/0b3f5c85b4e832413a32758701046ae9 to your computer and use it in GitHub Desktop.
Save markstgodard/0b3f5c85b4e832413a32758701046ae9 to your computer and use it in GitHub Desktop.
addr_test.go (ginkgo 3)
var _ = Describe("Adder", func() {
Describe("Add", func() {
Context("when summands are positive", func() {
It("adds two numbers", func() {
sum, err := Add(2, 3)
Expect(err).NotTo(HaveOccurred())
Expect(sum).To(Equal(5))
})
})
Context("when summand is negative", func() {
It("returns an err", func() {
_, err := Add(-1, -1)
Expect(err).To(HaveOccurred())
})
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment