Permalink
Browse files

adding autotest rules to catch specs in spec/other

  • Loading branch information...
1 parent 3640594 commit f68f7140e6572b3b0b87fa8dccb8ae83cc1b10fc @rick rick committed Aug 8, 2009
Showing with 20 additions and 0 deletions.
  1. +20 −0 .autotest
View
@@ -0,0 +1,20 @@
+# this will prevent autotest from watching unneeded
+# directories and files for changes
+Autotest.add_hook :initialize do |at|
+ %w[.svn .git vendor log doc public tmp stories].each do |pattern|
+ at.add_exception(pattern+'/')
+ end
+
+ # add rules for /other/ specs
+ at.add_mapping(%r%^spec/other/.*rb$%) do |filename, _|
+ filename
+ end
+
+ at.add_mapping(%r%^lib/(.*)\.rb$%) do |_, m|
+ ["spec/other/#{m[1]}_spec.rb"]
+ end
+
+ at.add_mapping(%r%^(spec/(spec_helper|shared/.*)|config/(boot|environment(s/test)?))\.rb$%) do
+ at.files_matching %r%^spec/other/.*_spec\.rb$%
+ end
+end

0 comments on commit f68f714

Please sign in to comment.