我已經建立了spec/javascripts/spec.js.coffee
,並有spec/javascripts
3個測試的一個spec文件。當我在瀏覽器中運行茉莉花時,3個測試運行。從命令行運行守衛茉莉花不運行任何規格
當我跑衛和啓動並運行後衛,茉莉,它發現並運行了所有的考試,就像這樣:
$ bundle exec guard
Guard uses GNTP to send notifications.
Guard is now watching at '/workpath'
Guard::Jasmine starts Unicorn test server on port 52512 in development environment.
Waiting for Jasmine test runner at http://localhost:52512/jasmine
Run all Jasmine suites
Run Jasmine suite at http://localhost:52512/jasmine
Finished in 0.013 seconds
3 specs, 0 failures
Done.
但是,當我從終端運行guard-jasmine
,沒有規範的發現:
$ guard-jasmine
Guard::Jasmine starts Unicorn test server on port 53307 in test environment.
Waiting for Jasmine test runner at http://localhost:53307/jasmine
Run all Jasmine suites
Run Jasmine suite at http://localhost:53307/jasmine
Finished in 0.001 seconds
0 specs, 0 failures
Done.
Guard::Jasmine stops server.
任何想法,我需要改變,以幫助CLI亞軍找到我的規格?
謝謝。
編輯:加入相關Guardfile信息:
guard :jasmine, timeout: 120, server_timeout: 120, server_env: "test" do
watch(%r{spec/javascripts/spec\.(js\.coffee|js|coffee)$}) { 'spec/javascripts' }
watch(%r{spec/javascripts/.+_spec\.(js\.coffee|js|coffee)$})
watch(%r{app/assets/javascripts/(.+?)\.(js\.coffee|js|coffee)(?:\.\w+)*$}) { |m| "spec/javascripts/#{ m[1] }_spec.#{ m[2] }" }
end
你可以顯示你的Guardfile嗎? – Rahul
絕對,但它現在已經修復! (請參閱我自己的答案)。 – jcm