Skip to content

Instantly share code, notes, and snippets.

@csmith0651
Created October 17, 2016 20:01
Show Gist options
  • Save csmith0651/097f4e4e5773a7f5e4193049d7585987 to your computer and use it in GitHub Desktop.
Save csmith0651/097f4e4e5773a7f5e4193049d7585987 to your computer and use it in GitHub Desktop.
var svc S3Fetcher.S3Fetcher
var err error
var jsonData string = goodJson
JustBeforeEach(func() {
svc, err = S3Fetcher.NewStringFetcher(jsonData)
})
Context("ReadPersonFromS3", func() {
It("successfully reads data from S3", func() {
Expect(ReadPersonFromS3(svc)).To(HaveLen(2))
})
Context("fails to read data from S3", func() {
BeforeEach(func() {
jsonData = ""
})
It("because of JSON format error", func() {
_, err := ReadPersonFromS3(svc)
Expect(err).To(HaveOccurred())
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment