我將我的.autotest
文件更改爲與基於Ruby的項目一起使用。爲什麼自動測試不起作用?
之後,當我想將它用於Rails時,它使用我用於Ruby項目的.autotest
配置設置。
我卸載了自動測試並重新安裝了它,但沒有運氣。 我也刪除了根目錄中的.autotest
文件,但它不起作用。
我將我的.autotest
文件更改爲與基於Ruby的項目一起使用。爲什麼自動測試不起作用?
之後,當我想將它用於Rails時,它使用我用於Ruby項目的.autotest
配置設置。
我卸載了自動測試並重新安裝了它,但沒有運氣。 我也刪除了根目錄中的.autotest
文件,但它不起作用。
我試圖讓autotest啓動並運行。我剛安裝了寶石。在我的Rails應用程序中運行autotest
或autotest --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
謝謝,它的工作原理 – 2009-06-23 13:02:26
FWIW:在我的develompent.rb文件中包含'autotest-rails'時出現了一些問題。我切換到只是config.gem'autotest',它似乎一切正常。 – 2011-09-19 20:27:50
你如何啓動自動測試?如果你使用autotest --rails
它肯定會工作。
/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
如果您使用Rails 3.1或更高版本,我強烈建議使用rspec的TDD保護。它像魔術一樣工作。 https://github.com/guard/guard
在英語中,句子以大寫字母開頭,單詞「I」大寫。 – 2010-05-11 00:46:42