2012-07-23 4 views
5

が、私はこのコードを持っているだけでなく、「与えられた理由は」持っている「pendings」を得ることができます保留中のRSpecのどのように私は私のテキストと

Managing Users Given a practitioner logged in. Visiting the users #index page. 
# No reason given 
# ./spec/requests/role_users_spec.rb:78 
Managing Users Given a practitioner logged in. Visiting the users #index page. 
# No reason given 
# ./spec/requests/role_users_spec.rb:79 

は、どのように私はそれらpendingsではなく

が、私は保留中の単語の後に、ブロックの前にいくつかのテキストを入れてみたが、それは助けにはならなかった「与えられた理由なし」のテキストを持って取得することができます - それをラインの終わりに現れた - しかし、私はまだすべての理由がありません。

答えて

10

pending自体は方法であり、通常の使用の場合は次のようなものです:

のように、

it "should say yo" do 
    pending "that's right, yo" 
    subject.yo!.should eq("yo!") 
    end 

出力だから、

Pending: 
    Yo should say yo 
    # that's right, yo 
    # ./yo.rb:8 

、あなたは短い形式を使用したいと思うでしょう

its(:yo!) {should eq("yo!") } 

保留中と印を付けるには、いくつかのオプションがあります。

xits(:you!) {should eq("yo!") } 
pending(:you!) {should eq("yo!")} 

しかし、あなたがすべきメッセージ、と保留を取得する:あなたは出力

Yo yo! 
    # waiting for client 
    # ./yo.rb:16 
をあげる

its(:yo!) {pending "waiting on client"; should eq("yo!") }