Skip to content

Instantly share code, notes, and snippets.

@gmalouf
Created May 1, 2015 15:39
Show Gist options
  • Save gmalouf/51a8722b50f6a9d30404 to your computer and use it in GitHub Desktop.
Save gmalouf/51a8722b50f6a9d30404 to your computer and use it in GitHub Desktop.
package spray.testkit
import org.specs2.execute.{ Failure, FailureException }
import org.specs2.specification.core.{ Fragments, SpecificationStructure }
import org.specs2.specification.create.DefaultFragmentFactory
trait Specs2Interface extends TestFrameworkInterface with SpecificationStructure {
def failTest(msg: String) = {
val trace = new Exception().getStackTrace.toList
val fixedTrace = trace.drop(trace.indexWhere(_.getClassName.startsWith("org.specs2")) - 1)
throw new FailureException(Failure(msg, stackTrace = fixedTrace))
}
override def map(fs: ⇒ Fragments) = super.map(fs).append(DefaultFragmentFactory.step(cleanUp()))
}
trait NoAutoHtmlLinkFragments extends org.specs2.specification.dsl.ReferenceDsl {
override def linkFragment(alias: String) = super.linkFragment(alias)
override def seeFragment(alias: String) = super.seeFragment(alias)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment