Test functionality in isolation with Autospec
Ruby posted about 1 year ago by christian
This configuration will make autospec run “spec/models/xyz_spec” when a file in “lib/xyz/ is modified”. No other tests are run.
Put the following code in ./.autotest:
1 Autotest.add_hook :initialize do |at| 2 at.clear_mappings 3 %w{.svn .hg .git vendor}.each {|exception| at.add_exception(exception)} 4 5 at.add_mapping(%r%^lib/xyz/.*\.rb$%) { 6 at.files_matching %r%^spec/models/xyz_spec\.rb$% 7 # 8 # Uncomment if more tests are needed... 9 # + at.files_matching %r%^spec/models/xyz_spec\.rb$% 10 # 11 } 12 end