Created
March 21, 2019 02:02
-
-
Save markstgodard/0b3f5c85b4e832413a32758701046ae9 to your computer and use it in GitHub Desktop.
addr_test.go (ginkgo 3)
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
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