サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
Wikipedia
etorreborre.github.io
class HelloWorldSpec extends Specification: def is = s2""" This is a specification for the 'Hello world' string The 'Hello world' string should contain 11 characters $e1 start with 'Hello' $e2 end with 'world' $e3 """ def e1 = "Hello world" must haveSize(11) def e2 = "Hello world" must startWith("Hello") def e3 = "Hello world" must endWith("world") /** This is the "Unit" style for specifications *
There are many ways to define expectations in specs2. You can define expectations with anything that returns a Result: Boolean Standard result Matcher result Scalacheck property Mock expectation DataTable Forms Boolean resultsThis is the simplest kind of result you can define for an expectation but also the least expressive!Here's an example: "This is hopefully true" ! (1 != 2) This can be useful
このページを最初にブックマークしてみませんか?
『etorreborre.github.io』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く