guard-jasmine-headless-webkit icon indicating copy to clipboard operation
guard-jasmine-headless-webkit copied to clipboard

Run all does not find all specs

Open logankoester opened this issue 13 years ago • 4 comments

Perhaps the mistake is in my implemenation, but I attempted to follow the README ;-)

When I modify an individual file, it runs all the related spec as it should. But when I hit [return] in Guard to call run_all, I get this empty output:

Guard::JasmineHeadlessWebkit running all specs...
PASS: 0 tests, 0 failures, 0.001 secs.
[console] "Selector invalid or missing!"
[...]
Compiling rails assets with Guard::RailsAssets::RailsRunner.
Assets compiled.

The relevant sections of my Guardfile are:

require 'jasmine-headless-webkit'

group :utilities do
  guard 'rails-assets', :digest => true do
    watch(%r{^app/assets/javascripts/(.*)\.coffee})
  end
end

group :testing do
  guard 'jasmine-headless-webkit', :all_on_start => false do
    watch(%r{^public/assets/.*\.js$})
    watch(%r{^spec/javascripts/.*\.js})
  end
end

My code is in app/assets/*.js.coffee, and my specs are in spec/javascripts/*.js.coffee... pretty standard as far as I know.

My best guess is that perhaps the assets are not compiled in time for jasmine-headless-webkit to find them. Do you have any advice for me?

logankoester avatar Oct 17 '11 20:10 logankoester

On 10/17/11 4:39 PM, Logan Koester wrote:

Perhaps the mistake is in my implemenation, but I attempted to follow the README ;-)

When I modify an individual file, it runs all the related spec as it should. But when I hit [return] in Guard to call run_all, I get this empty output:

 Guard::JasmineHeadlessWebkit running all specs...
 PASS: 0 tests, 0 failures, 0.001 secs.
 [console] "Selector invalid or missing!"
 [...]
 Compiling rails assets with Guard::RailsAssets::RailsRunner.
 Assets compiled.

This looks like the guards are being run out of order. How are you invoking the guard command on the command line?

Try putting both guards sequentially in one group:

 group :utilities do
   guard 'rails-assets', :digest =>  true do
     watch(%r{^app/assets/javascripts/(.*)\.coffee})
   end
   guard 'jasmine-headless-webkit', :all_on_start =>  false do
     watch(%r{^public/assets/.*\.js$})
     watch(%r{^spec/javascripts/.*\.js})
   end
 end

The issue may be the execution order of groups, which would make it a problem with Guard itself, but I can't be certain until I get some more info from you.

johnbintz avatar Oct 17 '11 21:10 johnbintz

Sure, what information do you need?

logankoester avatar Oct 17 '11 22:10 logankoester

What the results of sticking both Guards into the same group (or no group at all) does.

johnbintz avatar Oct 17 '11 23:10 johnbintz

I will have to get back to you tomorrow, I am swamped with other work at the moment.

logankoester avatar Oct 18 '11 22:10 logankoester