我想設置我的Rails項目,使所有的貢獻者所需要的驗證是一個命令,目前我們已經在運行: rake test
但現在我們也希望使用rubocop進行靜態分析: rubocop -R -a
我希望這可以在一個簡單的rake任務中執行。如果重寫'rake test'來運行rubocop,然後運行rails項目的標準rake測試工具,那麼很好,因爲沒有人會記得更改命令。但是如果我必須創建一個單獨的
其實我試圖解決這個問題: 不要使用多個頂級介紹 - 嘗試巢他們。 描述的第一個參數應該是被測試的類或模塊。 我有這種格式的測試計劃八: describe 'PublicanCreatorsCreate.init_docu_work' do
it 'accesses a directory and creates there an initial documentation' do
我有以下代碼 # colours a random cell with a correct colour
def colour_random!
while true do
col, row = rand(columns), rand(rows)
cell = self[row,col]
if cell.empty? then
ce
在我的Rails應用程序中,我使用Rubocop來檢查問題。今天它給了我這樣一個錯誤:Assignment Branch Condition size for show is too high。這裏是我的代碼: def show
@category = Category.friendly.find(params[:id])
@categories = Category.all