Skip to content

Commit

Permalink
テストコードを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuchitama committed Sep 23, 2014
1 parent d10ed90 commit bc8d644
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/test/resources/test_names.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hoge
fuga
piyo
15 changes: 7 additions & 8 deletions src/test/scala/NameSelectorSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import com.example.NameSelector

class NameSelectorSpec extends FlatSpec with ShouldMatchers {

// NameSelector#names に参加者の名前が含まれることを試験
"names" should "contains names of participants" in {
val names = NameSelector.names

// 1件以上の名前があること
names.size should be > 0
// 名前が含まれていること
names should contain("aa7th")
// NameSelector#namesFromFilePathが指定のファイルから名前を読み込むことを試験
"namesFromFilePath" should "read names from file" in {
val path = "src/test/resources/test_names.txt"

val actuary = NameSelector.namesFromFile(path)
actuary.size should be === 3
actuary should be === List("hoge", "fuga", "piyo")
}
}

0 comments on commit bc8d644

Please sign in to comment.