2009-06-22 52 views
0

我將我的.autotest文件更改爲與基於Ruby的項目一起使用。爲什麼自動測試不起作用?

之後,當我想將它用於Rails時,它使用我用於Ruby項目的.autotest配置設置。

我卸載了自動測試並重新安裝了它,但沒有運氣。 我也刪除了根目錄中的.autotest文件,但它不起作用。

+3

在英語中,句子以大寫字母開頭,單詞「I」大寫。 – 2010-05-11 00:46:42

回答

7

我試圖讓autotest啓動並運行。我剛安裝了寶石。在我的Rails應用程序中運行autotestautotest --rails開始自動測試,但它不運行單個測試。它報告說沒有任何。


UPDATE:

剛發現我需要安裝autotest-rails爲好。

您還應該安裝autotest-fsevent以確保自動測試不是始終在輪詢。

我已將我的自測日結果發佈在http://ryanbooker.com/archive/autotest-your-rails-apps

短篇小說:

sudo gem install ZenTest autotest-rails autotest-fsevent autotest-growl redgreen 

編輯你的〜/ .autotest

# Include plugins 
require 'autotest/fsevent' 
require 'autotest/growl' 
require 'redgreen/autotest' # yes this is correct 

# Skip some paths 
Autotest.add_hook :initialize do |autotest| 
    %w{.git .DS_Store ._* vendor}.each { |exception| autotest.add_exception(exception) } 
    false 
end 

您可以啓動自動測試:

cd myrailsapp 
autotest 
+0

謝謝,它的工作原理 – 2009-06-23 13:02:26

+0

FWIW:在我的develompent.rb文件中包含'autotest-rails'時出現了一些問題。我切換到只是config.gem'autotest',它似乎一切正常。 – 2011-09-19 20:27:50

0

你如何啓動自動測試?如果你使用autotest --rails它肯定會工作。

+0

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I.:lib:test -rubygems -e「%w [test/unit test/shoulda_macros/searchable.rb test/functional/test_controller_test.rb test/test_helper.rb] .each {| f | require f}「| unit_diff -u nope,上面是autotest的初始軌跡--rails – 2009-06-22 19:14:08