Skip to content

Instantly share code, notes, and snippets.

@jbrechtel
Created September 17, 2012 00:17
Show Gist options
  • Select an option

  • Save jbrechtel/3734950 to your computer and use it in GitHub Desktop.

Select an option

Save jbrechtel/3734950 to your computer and use it in GitHub Desktop.
really bad cake pattern example
class Foo {
val emailer: EmailService
}
trait Fakes {
val emailer = new FakeEmailService()
}
trait RealThings {
val emailer = new SmtpEmailService()
}
val fakeFoo = new Foo with Fakes
val realFoo = new Foo with RealThing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment