0
我試圖驗證傳遞塊的方法的期望。一切工作完全正常,只要我不使用任何關鍵字,但我需要使用任何關鍵字的,以便不符合期望的所有部分。如何在摩卡期望中傳遞一個塊內的任意空間(Ruby)
實際功能要測試的呼叫。
RestClient::Request.execute(:method => :post, :url => some_url, :headers => {}.to_json, :payload => {}.to_json)
,當我測試它,
這些工作(注意:任何的使用)
RestClient::Request.expects(:execute).with(:method => :post, :url => some_url, :headers => {}.to_json, :payload => {}.to_json)
RestClient::Request.stubs(:execute).with(:method => :post, :url => some_url, :headers => {}.to_json, :payload => {}.to_json)
RestClient::Request.stubs(:execute).with(anything)
這不(注意用法任何東西)
RestClient::Request.stubs(:execute).with(:method => :post, :url => some_url, :headers => anything, :payload => anything)
我的問題是,我只想驗證URL和方法,而不是請求的標頭和正文。我錯過了什麼?