问题
I have a Rails 3 app that uses RSpec2 as my testing framework, and I'm able to use autotest to watch my model and spec directories for changes and re-run my spec suite when files change.
I'd like to add a directory with some custom classes in it (RAILS_ROOT/lib/some_project/lib/.rb) and their corresponding specs (RAILS_ROOT/spec/some_project/_spec.rb) so that autotest will automatically pick up changes to all of those files and re-run as needed.
How do I get autotest to watch these files in these other directories? I suspect I have to add something to RAILS_ROOT/autotest/discover.rb, but I'm not exactly sure what to do.
回答1:
This looks like what you want to do: http://seandenigris.com/blog/?p=337
来源:https://stackoverflow.com/questions/3605267/adding-custom-directories-source-and-spec-to-autotest-in-a-rails-3-project