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

Problem with paths

Open grassator opened this issue 13 years ago • 6 comments

I tried to use following code to run testing:

guard 'jasmine-headless-webkit' do
    watch(%r{^spec/coffeescripts/(.*)\.coffee$}) { |m| ("spec/coffeescripts/%s.coffee" % m[1]) }
end

But after running tests in single spec file it also runs all of them. Adding ./ at the start of the path fixes that:

guard 'jasmine-headless-webkit' do
    watch(%r{^spec/coffeescripts/(.*)\.coffee$}) { |m| ("./spec/coffeescripts/%s.coffee" % m[1]) }
end

grassator avatar Oct 04 '11 06:10 grassator

Was the test that was run a successful test? If so, that's a feature, not a bug. jasmine-headless-webkit always re-runs all tests on a success by default, to ensure that any changes made to the current code under test doesn't affect the rest of the system. If you want to turn that off, pass in :full_run => false as a Guard option.

(This also means I'm lacking a bit in documentation, as I added the ability to pass in additional options that are really options to Jasmine::Headless::Runner and forgot to write about it here. :( Bad programmer!)

If that's not what you were expecting, then it's definitely a bug and I'll look into it.

johnbintz avatar Oct 04 '11 12:10 johnbintz

Thanks, that does explain behavior that I had originally but it still means that there's some kind of bug inside path handling code because second piece of code that I posted doesn't cause re-run after successful test.

grassator avatar Oct 04 '11 13:10 grassator

I tried adding :full_run => false as you suggested while putting path back as it was in first snippet but it didn't change anything for some reason :(

grassator avatar Oct 04 '11 13:10 grassator

OK I'll take a look into this when I get a chance. Can you give the path of a spec file in the filesystem you're trying to find? I'll help me in writing a test.

johnbintz avatar Oct 05 '11 12:10 johnbintz

here's my directory structure

src/
spec/
    coffeescripts/
    javascripts/
        support/
            jasmine.yml

jasmine.yml contains this:

src_files: 
  - "*.coffee"

spec_files:
  - "*[Ss]pec.coffee"

src_dir: src
spec_dir: spec/coffeescripts

grassator avatar Oct 05 '11 13:10 grassator

OK, the issue was actually with the runner itself. Go get the latest git HEAD of jasmine-headless-webkit and see if that fixes your problem.

johnbintz avatar Oct 17 '11 13:10 johnbintz