Created
January 5, 2016 07:08
-
-
Save kenji0x02/66a0c30040e40487d4e3 to your computer and use it in GitHub Desktop.
Scala Specs2での事前・事後処理いろいろマスター
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 実際に動かしていないのでタイポがあったら教えてください>< | |
// [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 { | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.github.com/mzkrelx/6150705