spec/watchr.rb in revenc-0.1.2 vs spec/watchr.rb in revenc-0.1.3

- old
+ new

@@ -1,7 +1,9 @@ # Watchr: Autotest like functionality # +# gem install watchr +# # Run me with: # # $ watchr spec/watchr.rb require 'term/ansicolor' @@ -24,11 +26,11 @@ def all_feature_files Dir['features/*.feature'] end def all_spec_files - files = Dir['spec/revenc/*.rb'] + files = Dir['spec/**/*_spec\.rb'] end def run(cmd) pid = fork do @@ -101,22 +103,23 @@ prompt # -------------------------------------------------- # Watchr Rules # -------------------------------------------------- -#watch( '^features/(.*)\.feature' ) { |m| run_feature(m[0]) } watch( '^features/(.*)\.feature' ) { run_default_cucumber } watch( '^bin/(.*)' ) { run_default_cucumber } watch( '^lib/(.*)' ) { run_default_cucumber } watch( '^features/step_definitions/(.*)\.rb' ) { run_default_cucumber } watch( '^features/support/(.*)\.rb' ) { run_default_cucumber } watch( '^spec/(.*)_spec\.rb' ) { |m| run_spec(m[0]) } -# watch( '^lib/revenc/io.rb' ) { run_default_spec } -watch( '^lib/revenc/errors.rb' ) { run_default_spec } -watch( '^lib/revenc/lockfile.rb' ) { run_default_spec } +# specify just the lib files that have specs +# TODO: This can be determined automatically from the spec file naming convention +watch( '^lib/revenc.rb' ) { run_default_spec } +watch( '^lib/errors.rb' ) { run_default_spec } +watch( '^lib/io.rb' ) { run_default_spec } # -------------------------------------------------- # Signal Handling # --------------------------------------------------