Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The spec is not executed when file is changed #10

Closed
dnagir opened this issue Nov 5, 2011 · 6 comments
Closed

The spec is not executed when file is changed #10

dnagir opened this issue Nov 5, 2011 · 6 comments

Comments

@dnagir
Copy link
Member

dnagir commented Nov 5, 2011

When I update and save the spec (or implementation) it is not re-executed.

The Guard file:

  guard 'jasmine' do
    watch(%r{app/assets/javascripts/(.+)\.(js\.coffee|js)}) { |m| "spec/javascripts/#{m[1]}_spec.#{m[2]}" }
    watch(%r{spec/javascripts/(.+)_spec\.(js\.coffee|js)})  { |m| "spec/javascripts/#{m[1]}_spec.#{m[2]}" }
    watch(%r{spec/javascripts/spec\.(js\.coffee|js)})       { "spec/javascripts" }
  end

But when I update the spec/javascripts/spec.js.coffthen all specs are indeed executed.

@netzpirat
Copy link
Contributor

Is Guard detecting the modification and guard-jasmine tries to run the spec? So you see an output like this:

Run Jasmine suite spec/javascripts/backbone/views/footer_spec.js.coffee
Run Jasmine suite at http://smackaho.st:8888/jasmine?spec=App.Views.Footer

If this is the case, does the Jasmine runner execute the correct spec when you paste the given URL into your browser?

@dnagir
Copy link
Member Author

dnagir commented Nov 6, 2011

It is interesting, because Guard detects the change, but the spec is not executed (So I don't see Run Jasmine...)

The reason why I say that the change is detected is because I can see the block in the Guard executed:

watch(%r{spec/javascripts/(.+)_spec\.(js\.coffee|js|coffee)$})  { |m| puts m.inspect; "spec/javascripts/#{m[1]}_spec.#{m[2]}" }

This DOES output the match, but does NOT execute anything.

The output is:

#<MatchData "spec/javascripts/app/controllers/user_spec.coffee" 1:"app/controllers/user" 2:"coffee">

So I suspect the guard-jasmine ignores it for some reason.

@dnagir
Copy link
Member Author

dnagir commented Nov 6, 2011

Thanks a lot for the fix. It is also related to #11 in some way that you've already merged.

Just wondering if you've released it or I have to point to git master instead?

@netzpirat
Copy link
Contributor

I already released 0.8.2 with all your pull requests and my changes. Thanks again for contributing.

@dnagir
Copy link
Member Author

dnagir commented Nov 6, 2011

That's awesome. Thanks for that.

@netzpirat
Copy link
Contributor

Thanks for the info, now it's clear what happens. The problem is, that the file user.coffee doesn't pass the inspector, which is responsible for filtering unwanted resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants