2012-12-06 1 views
4

어떤 사양을 실행하고 spec/javascripts 3 개 테스트 한 사양 파일이 없습니다. jasmine을 브라우저에서 실행하면 세 가지 테스트가 실행됩니다.실행 가드 자스민 내가 <code>spec/javascripts/spec.js.coffee</code>을 설정 한

내가 가드를 실행하고 시작 가드 재스민을 실행 찾은 그래서 같은 내 모든 테스트를 실행하면 :

$ 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 
+0

Guardfile을 표시 할 수 있습니까? – Rahul

+0

절대적으로, 그러나 지금 고쳐졌습니다! 내 자신의 대답을 참조하십시오. – jcm

답변

2

문제는 레이크 작업과 실행 guard-jasmine 반면 시험에 할, 기본적으로 개발 환경에 guard 실행이었다.

config.assets.debug = true을 테스트 환경 구성에 추가하여 수정했습니다.

+0

어디에 추가했는지 자세히 설명해 주시겠습니까? 그것은 바로 개발 환경에서 실행되도록하는 것이 었습니다. 바로 server_env를 사용했습니다. "개발"은 똑같이해야합니까? –