Permalink
Browse files

Ensure guard runs specs for .js.coffee files

With the default Guardfile, newest_js_file will try to look for file matching "spec/javascripts/foo.js_spec" instead of "spec/javascripts/foo_spec"
  • Loading branch information...
1 parent 6e2be80 commit 9408f614af94387dbbb50f57b179179d6347502b @sidonath committed Feb 16, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/guard/jasmine-headless-webkit/templates/Guardfile
@@ -9,7 +9,7 @@ spec_location = "spec/javascripts/%s_spec"
guard 'jasmine-headless-webkit' do
watch(%r{^app/views/.*\.jst$})
watch(%r{^public/javascripts/(.*)\.js$}) { |m| newest_js_file(spec_location % m[1]) }
- watch(%r{^app/assets/javascripts/(.*)\.(js|coffee)$}) { |m| newest_js_file(spec_location % m[1]) }
+ watch(%r{^app/assets/javascripts/(.*?)\.(js(\.coffee)?|coffee)$}) { |m| newest_js_file(spec_location % m[1]) }
watch(%r{^spec/javascripts/(.*)_spec\..*}) { |m| newest_js_file(spec_location % m[1]) }
end

0 comments on commit 9408f61

Please sign in to comment.