testdouble / jasmine-rails

A Jasmine runner for rails projects that's got you covered in both the terminal and the browser
http://rubygems.org/gems/jasmine-rails
MIT License
378 stars 154 forks source link

Tests are run twice in console when using spring #165

Closed joker-777 closed 9 years ago

joker-777 commented 9 years ago

The tests are run twice if you use spring. My command looks like this spring rake spec:javascript. Using bundle exec rake spec:javascript works though. The same weird behavior also happens when I add RAILS_ENV=test'. For example RAILS_ENV=test bundle exec rake spec:javascript.

searls commented 9 years ago

try disabling spring and see what happens

Edit: LOL, you already tried this and it worked.

In that case, I'm not sure what the cause is. It's moderately amazing that such a small codebase could crop up so many bizarre problems like this as if by magic, but I guess my next step would be to debug the relationship between spring and sprockets; it sounds like perhaps assets are being added twice (via some state not resetting) and then not being deduped somehow?

joker-777 commented 9 years ago

Strange thing happend. After I removed the gem spring-commands-rspec it coplained that it couldn't load .rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/specifications/default/bin/rake when I wanted to run any rake command. Reinstalling rake fixed this and it also fixed this problem here too. I can't reproduce this error anymore, with or without spring-commands-rspec. Thanks for you quick response. I was really impressed.