johnbintz/guard-jasmine-headless-webkit — Issue #14: My tests are run twice.
Author: benogle
Created: 2011-11-12 21:06:41+00:00
State: open

in the guard file:

guard 'jasmine-headless-webkit', :full_run => false, :all_on_start => false do
watch('spec/javascripts/support/jasmine.yml') { |m| "spec/javascripts" }
watch(%r{^app/assets/javascripts/(.*)\.(js|coffee)$}) do |m|
# Don't run tests if there was a failure compiling the JS
if Dir["public/assets/editor-*.js"].any?
specific_file = newest_js_file("spec/javascripts/#{m[1]}")
all_tests = "spec/javascripts"
specific_file or all_tests
end
end
watch(%r{^spec/javascripts/.*\.(js|coffee)$})
end

Output when I save a file:

F.....F.....
FAIL: 12 tests, 2 failures, 0.178 secs.

Color picker pane fails. (/mytest.coffee:12)
Expected '2' to equal 3. (line ~13)
expect('2').toEqual(3);

Color picker pane fails. (/mytest.coffee:12)
Expected '2' to equal 3. (line ~13)
expect('2').toEqual(3);

When it runs all tests, it does not run them twice.