簡體   English   中英

有沒有辦法用guard + guard-rspec強制運行所有規格?

[英]Is there a way to force run all specs with guard + guard-rspec?

是否有類似於autotest的ctrl + c強制運行所有規格? 我還在努力調整我的.Guard文件,但暫時可以強行運行所有規格而不重新啟動后衛嗎? ctrl + c退出警衛。

馬克建議的posix信號不再用於與守衛交互。 有關新的交互方式,請參閱自述文件中標題為“交互”的部分。

要觸發每個守衛的run_all方法,只需在守衛終端點擊Enter即可。 要觸發rspec的run_all方法,請鍵入rspec並按Enter鍵。

https://github.com/guard/guard#interactions

當Guard無事可做時,您可以與Guard交互並輸入命令。 Guard了解以下命令:

↩: Run all Guards.
h, help: Show a help of the available interactor commands.
r, reload: Reload all Guards.
n, notification: Toggle system notifications on and off.
p, pause: Toggles the file modification listener. The prompt will change to p> when paused. This is useful when switching Git branches, rebase Git or change whitespace.
e, exit: Stop all Guards and quit Guard.

所以,基本上你進入Guard正在運行的終端並按下Enter / return。

可能最簡單的方法是使用Spork ,然后簡化你的Guardfile:

# Guardfile
guard 'rspec', :version => 2, :cli => '--drb' do # :cli => is important!
  watch(%r{^spec/}) { "spec" }
  watch(%r{^app/}) { "spec" }
  watch('config/routes.rb') { "spec" }
end

specapproutes.rb中的任何內容發生更改時,這將在spec文件夾中運行任何內容,只要您保存它,就會節省大量時間。

使用growl (mac)或libnotify (linux)gem來獲取彈出通知。 然后你只需在你的編輯器中編碼,每次保存后不久你就會得到一個彈出通過/失敗通知。 如果它是一個傳遞你只是繼續編碼 - 如果它是一個失敗你彈出到終端並檢查錯誤是什么。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM