Closed brewster1134 closed 10 years ago
What does your Guardfile look like?
### Guard::Konacha
# available options:
# - :run_all_on_start, defaults to true
# - :notification, defaults to true
# - :rails_environment_file, location of rails environment file,
# should be able to find it automatically
guard :konacha, run_all_on_start: false do
watch(%r{^app/assets/javascripts/release/(.*).(?:js|coffee)$}) { |m| "#{m[1]}_spec" }
watch(%r{^app/views/home/assets/demos/_(.*).haml$}) { |m| "#{m[1]}_spec" }
watch(%r{^spec/javascripts/*.coffee$})
end
guard :rake, :run_on_start => false, :task => 'release:js' do
watch(%r{^app/assets/javascripts/release/(.*).(?:js|coffee)$})
end
guard :rake, :run_on_start => false, :task => 'release:css' do
watch(%r{^app/assets/stylesheets/internal/_(.*).(?:scss|sass)$})
watch(%r{^app/assets/stylesheets/release/_(.*).(?:scss|sass)$})
end
I think your regular expressions is off, %r{^spec/javascripts/*.coffee$}
doesn't match foo_spec.coffee
.
First, you should name your coffeescript files according to the asset pipeline convention of .js.coffee
, then use watch(%r{^spec/javascripts/.+_spec(\.js|\.js\.coffee)$})
to match files in your spec directory.
i have made the suggested updates, but still have the same issue....
guard :konacha, run_all_on_start: false do
watch(%r{^app/assets/javascripts/release/(.*).(js|js.coffee)$}) { |m| "#{m[1]}_spec" }
watch(%r{^spec/javascripts/.*.(?:js|coffee)$})
end
making changes to foo.js.coffee
outputs...
12:00:07 - DEBUG - Trying to run Guard::Konacha#run_on_modifications with ["foo_spec"]
12:00:07 - DEBUG - Hook :run_on_changes_begin executed for Guard::Konacha
12:00:08 - DEBUG - Hook :run_on_changes_end executed for Guard::Konacha
12:00:08 - DEBUG - Command execution: stty -g 2>/dev/null
12:00:08 - DEBUG - Start interactor
however if i hit enter from guard to run all the tests, they run, or if i run from the cli, it works as well.
i made a test app to show this behavior here on the konacha_25
branch
with guard running, and modifications are made to foo.js.coffee
, the results of the spec are not shown. if you change foo_spec.js.coffee
, or hit enter from guard, the results are shown.
Awesome, that will be super helpful. I'll take a look soon.
Your issues should be addressed in this PR https://github.com/brewster1134/test/pull/2. Reopen if your still having problems.
I just installed guard-konacha and realized my specs were returning
0 tests passed
. When i run them manually, they pass.through guard w/ debug
with konacha...
Also, when i hit enter in guard, it runs ALL the tests ok as well.
Do i have to configure something else?