hoge
Last active
August 29, 2015 14:04
-
-
Save wshino/e7b11b57f4c8227eb3bd to your computer and use it in GitHub Desktop.
テストのときにfixtureを使うと便利かもしれない
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
/** | |
* Created by JP16163 on 2014/08/05. | |
*/ | |
class User(id:Int, name: String){ | |
def getName = name | |
} | |
object Main extends App { | |
pattern1 | |
def fixture = new { | |
val data1 = new User(0, "hoge") | |
val data2 = new User(1, "fuga") | |
} | |
def pattern1 = { | |
val f = fixture | |
import f._ | |
println("data1 = " + data1.getName) | |
println("data2 = " + data2.getName) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment