Skip to content

Instantly share code, notes, and snippets.

@mgonto
Created December 21, 2012 19:41
Show Gist options
  • Save mgonto/4355240 to your computer and use it in GitHub Desktop.
Save mgonto/4355240 to your computer and use it in GitHub Desktop.
FactoryPal multiple template register
//Default template creation
FactoryPal.register[Person]() { person =>
person.name.mapsTo("gonto") and
person.age.isRandom
}
//Creating template for a certain name. This way you can create multiple templates for a certain class
FactoryPal.register[Person](Some('coolPerson)) { person =>
person.name.mapsTo("cool") and
person.age.isRandom
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment