alexgb / guard-konacha

Automatically run konacha tests through Guard
MIT License
31 stars 17 forks source link

Bugfix invalid file existence path when used in a Rails engine #23

Closed lcoq closed 10 years ago

lcoq commented 10 years ago

I am using guard-konacha since few months, and I had some troubles with the test files paths.

The problem appears because I am working on a Rails engine. The Rails root is available in myproject/test/dummy/, and the tests in myproject/spec/javascripts.

Konacha is initialized with a config.spec_dir = "../../spec/javascripts", and works fine this way.

When running guard-konacha, it skips the files because it checks for an invalid path (here, it checked myproject/spec/javascripts/spec/javascripts/my_test_file_spec.js.coffee).

I've updated the code to check file path existence starting with the Rails.root. AFAICT, this code should not change the current behavior for classic application architectures.

Please let me know if I have made something wrong. Thanks for your work !

lcoq commented 10 years ago

@alexgb The travis build failed on rbx-19mode. I do not think this is related to the changes made on this PR.

alexgb commented 10 years ago

Thanks. I think this should work fine.