Skip to content

Instantly share code, notes, and snippets.

@mossprescott
Created August 17, 2016 13:25
Show Gist options
  • Select an option

  • Save mossprescott/2699d6261d67ed9e52b24f69bcaf01df to your computer and use it in GitHub Desktop.

Select an option

Save mossprescott/2699d6261d67ed9e52b24f69bcaf01df to your computer and use it in GitHub Desktop.
Reducing bytecode size by extending an abstract class instead of a trait (per paulp)
/** Use Qspec if you can, QuasarSpecification only if you must.
* An abstract class allows the many trait forwarders to be reused
* by all the subclasses. Mixing in the trait means that your
* specification sprouts hundreds of pure forwarders.
*/
abstract class Qspec extends QuasarSpecification
trait QuasarSpecification extends AnyRef
with org.specs2.mutable.SpecLike
with org.specs2.matcher.ShouldExpectations
with org.specs2.matcher.MatchResultCombinators
with org.specs2.matcher.ValueChecks
with org.specs2.execute.PendingUntilFixed
with org.specs2.ScalaCheck
with org.specs2.scalaz.ScalazMatchers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment