Skip to content

Instantly share code, notes, and snippets.

@kenji0x02
Created January 5, 2016 07:08
Show Gist options
  • Save kenji0x02/66a0c30040e40487d4e3 to your computer and use it in GitHub Desktop.
Save kenji0x02/66a0c30040e40487d4e3 to your computer and use it in GitHub Desktop.
Scala Specs2での事前・事後処理いろいろマスター
// 実際に動かしていないのでタイポがあったら教えてください><
// [Caution] I don't check this code.
// GistのスニペットをREPLみたいに実行したいなあ。。(独り言)
// I want to execute Gist snipett like REPL from right click only..
class HogeTest extends with BeforeEach with AfterEach with BeforeAll with AfterAll {
sequential // DBテストなどの同期処理の時(本題と関係ないけど。。)
override protected def before: Any = {
println("===== before =====")
}
override protected def after: Any = {
println("===== after =====")
}
override def beforeAll = {
println("##### before #####")
}
override def afterbeforeAll = {
println("##### after #####")
}
trait TestScope extends Scope with After {
println("***** before *****")
def after = {
println("***** after *****")
}
}
// main test
"withTestScope" should {
"work from within a browser" in new TestScope {
}
}
}
"withoutTestScope" should {
"work from within a browser" in {
}
}
}
@kenji0x02
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment