Skip to content

Instantly share code, notes, and snippets.

@wshino
Last active August 29, 2015 14:04
Show Gist options
  • Save wshino/e7b11b57f4c8227eb3bd to your computer and use it in GitHub Desktop.
Save wshino/e7b11b57f4c8227eb3bd to your computer and use it in GitHub Desktop.
テストのときにfixtureを使うと便利かもしれない
/**
* 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