2012-06-08 6 views
26

私のテストケースの1つを"保留中"の状態にする必要があります。Specs2:メッセージの指定を無視しますか?

テストを実行したときに出力に表示される何らかのメッセージをお聞きしたいと思います。@Ignore("Pending: issue #1234 needs to be fixed")のJUnitのようなものです。

Specs2と同等の機能はありますか?

class MySpec extends mutable.Specification { 
    args(skipAll = true) // Can I include a message here in the output somehow? 

    "cool MyClass feature" should { 
    "which is broken unfortunately" in { 
     failure 
    } 
    } 
} 

ありがとうございます!

答えて

39

個々例えば、私はあなたが使用できると信じて:

class MySpec extends mutable.Specification { 

    "cool MyClass feature" should { 
    "which is broken unfortunately" in { 
     failure 
    }.pendingUntilFixed("message about the issue") 
    } 

} 

と、同じメッセージで保留中としてスペックのすべての例をマークするために、これを拡張する方法があります場合、私は知りませんあなたは望んでいるようです。

+6

あなたの例の本体で 'failure'の代わりに' Pending( "message")を使うこともできます(前に 'FailureException'が呼び出されていなければ、' pendingUntilFixedが最善のアプローチです) – Eric

+0

Thx for助け、また@Ericの代替アプローチです。 – rlegendi

+2

私は答えが実際に間違っていると思います - コンパイルしません。 .pendingUntilFixed( "問題についてのメッセージ")を1行上に移動する必要があります。 –

関連する問題