Skip to content

Instantly share code, notes, and snippets.

@oehme
Last active December 17, 2015 16:19
Show Gist options
  • Save oehme/5637774 to your computer and use it in GitHub Desktop.
Save oehme/5637774 to your computer and use it in GitHub Desktop.
@CreateWith(typeof(GuiceSpecCreator))
@InjectWith(typeof(EnglishModule))
describe Greeter "Interface Injection"{
@Inject
Greeter injected
fact "the subject is injected by Guice"{
subject.greet should be "Hello"
}
fact "spec variables are injected by Guice" {
injected.greet should be "Hello"
}
context "within a non-annotated context" {
fact "outer bindings are inherited" {
subject.greet should be "Hello"
}
}
@InjectWith(typeof(GermanModule))
context "within an annotated context" {
fact "the inner annotation takes precedence" {
subject.greet should be "Guten Tag"
injected.greet should be "Guten Tag"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment