Created
May 30, 2012 09:55
-
-
Save yamashiro/2835272 to your computer and use it in GitHub Desktop.
Traitつき無名クラス
This file contains 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
import org.specs2.mutable._ | |
trait BarTrait {} | |
class Hoge {} | |
class TraitGetClassTest extends Specification { | |
"Trait mixin " should { | |
"getClass " in { | |
val hoge = new Hoge with BarTrait | |
hoge.getClass.toString must_== "Hoge" | |
} | |
} | |
} |
具体的な目的としては、ログに"Hoge"という文字列を出したいんですよね…
確かに実装依存ですよね…
Yasushi さんの張ったspecs2のmatcherのソース明日見てみようっと…あざす
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ためしてないんですがspecs2だとこのへんでしょうか