Skip to content

Instantly share code, notes, and snippets.

@napicella
Created April 1, 2018 14:43
Show Gist options
  • Save napicella/a5b8db6d0fbd11acf9e74937cd89055f to your computer and use it in GitHub Desktop.
Save napicella/a5b8db6d0fbd11acf9e74937cd89055f to your computer and use it in GitHub Desktop.
Golang-patterns options
Context("Greeting with no Name option", func() {
It("returns default greeting", func() {
greeting := NewGreeting()
Expect(greeting.get()).To(Equal("Hello Stranger"))
})
})
Context("Greeting with Name option", func() {
It("returns custom greeting", func() {
greeting := NewGreeting(Name("Mickey"))
Expect(greeting.get()).To(Equal("Hello Mickey"))
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment