johnbintz / guard-jasmine-headless-webkit

Use Guard with jasmine-headless-webkit
http://johnbintz.github.com/jasmine-headless-webkit/
MIT License
34 stars 12 forks source link

Problem with paths #10

Open grassator opened 13 years ago

grassator commented 13 years ago

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
johnbintz commented 13 years ago

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.

grassator commented 13 years ago

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 commented 13 years ago

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 :(

johnbintz commented 13 years ago

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.

grassator commented 13 years ago

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
johnbintz commented 13 years ago

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.