alexgb/guard-konacha — pull request #23 by lcoq (2014-02-27 08:54:46+00:00)
Title: Bugfix invalid file existence path when used in a Rails engine

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 !