From 125ce1df12ce0fce961fe04813bc78013b0de32b Mon Sep 17 00:00:00 2001 From: James Herdman Date: Mon, 12 May 2008 07:34:46 -0400 Subject: [PATCH 01/16] Add exceptions for SCM directories and custom autotest mappings --- .../merb/templates/autotest/merb_rspec.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb index 9ff1f726..68c3b440 100644 --- a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb +++ b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb @@ -19,6 +19,9 @@ def initialize # :nodoc: # Ignore any happenings in these directories add_exception %r%^\./(?:doc|log|public|tmp)% + # Ignore SCM directories and custom Autotest mappings + %w[.svn .hg .git .autotest].each { |exception| add_exception(exception) } + # Ignore any mappings that Autotest may have already set up clear_mappings @@ -124,11 +127,9 @@ def handle_results(results) def consolidate_failures(failed) filters = Hash.new { |h,k| h[k] = [] } failed.each do |spec, failed_trace| - find_files.keys.select { |f| f =~ /spec\// }.each do |f| - if failed_trace =~ Regexp.new(f) - filters[f] << spec - break - end + if f = test_files_for(failed).find { |f| f =~ /spec\// } + filters[f] << spec + break end end filters From d0f29a46504e862b1a3b47fe4c14901112470984 Mon Sep 17 00:00:00 2001 From: James Herdman Date: Mon, 12 May 2008 18:11:58 -0400 Subject: [PATCH 02/16] Add the DRY and semantically friendly 'all_specs' method --- .../app_generators/merb/templates/autotest/merb_rspec.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb index 68c3b440..f5b7b65a 100644 --- a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb +++ b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb @@ -32,7 +32,7 @@ def initialize # :nodoc: end add_mapping %r%^spec/(spec_helper|shared/.*)\.rb$% do - files_matching %r%^spec/.*_spec\.rb$% + all_specs end # Any changes to a fixture will run corresponding view, controller and @@ -103,7 +103,7 @@ def initialize # :nodoc: # If any of the major files governing the environment are altered, run # everything add_mapping %r%^spec/spec_helper.rb|config/(init|rack|environments/test.rb|database.yml)% do # FIX - files_matching %r%^spec/(unit|models|controllers|views|functional)/.*_spec\.rb$% + all_specs end end @@ -175,6 +175,11 @@ def spec_commands private + # Runs +files_matching+ for all specs + def all_specs + files_matching %r%^spec/.*_spec\.rb$% + end + # Determines the paths we can expect tests or specs to reside, as well as # corresponding fixtures. def initialize_test_layout From a482243a32549a0cb559668a24c0eb6a5b37f56b Mon Sep 17 00:00:00 2001 From: James Herdman Date: Mon, 12 May 2008 18:12:44 -0400 Subject: [PATCH 03/16] Clean up handle_results --- .../merb/templates/autotest/merb_rspec.rb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb index f5b7b65a..e98b9063 100644 --- a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb +++ b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb @@ -112,16 +112,10 @@ def failed_results(results) end def handle_results(results) - @failures = failed_results(results) - @files_to_test = consolidate_failures @failures - unless $TESTING - if @files_to_test.empty? - hook :green - else - hook :red - end - end - @tainted = true unless @files_to_test.empty? + @failures = failed_results(results) + @files_to_test = consolidate_failures(@failures) + @files_to_test.empty? && !$TESTING ? hook(:green) : hook(:red) + @tainted = !@files_to_test.empty? end def consolidate_failures(failed) From e831ac4b102770d7d23c695975b42385880c0aa7 Mon Sep 17 00:00:00 2001 From: James Herdman Date: Mon, 12 May 2008 18:17:07 -0400 Subject: [PATCH 04/16] Better handling of stuff in /lib --- .../app_generators/merb/templates/autotest/merb_rspec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb index e98b9063..edaaa045 100644 --- a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb +++ b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb @@ -25,10 +25,10 @@ def initialize # :nodoc: # Ignore any mappings that Autotest may have already set up clear_mappings - # Any changes to a file in the root of the 'lib' directory will run any - # model test with a corresponding name. - add_mapping %r%^lib\/.*\.rb% do |filename, _| - files_matching %r%#{model_test_for(filename)}$% + # Anything in /lib could have a spec anywhere, if at all. So, look for + # files with roughly the same name as the file in /lib + add_mapping %r%^lib\/(.*)\.rb% do |_, m| + files_matching %r%^spec\/#{m[1]}% end add_mapping %r%^spec/(spec_helper|shared/.*)\.rb$% do From e9fe738f038ea3d4de16643e460e369d3c81eeb2 Mon Sep 17 00:00:00 2001 From: James Herdman Date: Mon, 12 May 2008 18:21:40 -0400 Subject: [PATCH 05/16] Remove baked-in support for fixtures. This is between you and your ORM --- .../merb/templates/autotest/merb_rspec.rb | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb index edaaa045..efa054a5 100644 --- a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb +++ b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb @@ -3,13 +3,18 @@ class RspecCommandError < StandardError; end +# This class maps your application's structure so Autotest can understand what +# specs to run when files change. +# +# Fixtures are _not_ covered by this class. If you change a fixture file, you +# will have to run your spec suite manually, or, better yet, provide your own +# Autotest map explaining how your fixtures are set up. class Autotest::MerbRspec < Autotest # +model_tests_dir+:: the directory to find model-centric tests # +controller_tests_dir+:: the directory to find controller-centric tests # +view_tests_dir+:: the directory to find view-centric tests - # +fixtures_dir+:: the directory to find fixtures in - attr_accessor :model_tests_dir, :controller_tests_dir, :view_tests_dir, :fixtures_dir + attr_accessor :model_tests_dir, :controller_tests_dir, :view_tests_dir def initialize # :nodoc: super @@ -35,16 +40,6 @@ def initialize # :nodoc: all_specs end - # Any changes to a fixture will run corresponding view, controller and - # model tests - add_mapping %r%^#{fixtures_dir}/(.*)s.yml% do |_, m| - [ - model_test_for(m[1]), - controller_test_for(m[1]), - view_test_for(m[1]) - ] - end - # Any change to a test or spec will cause it to be run add_mapping %r%^spec/(unit|models|integration|controllers|views|functional)/.*rb$% do |filename, _| filename @@ -174,13 +169,11 @@ def all_specs files_matching %r%^spec/.*_spec\.rb$% end - # Determines the paths we can expect tests or specs to reside, as well as - # corresponding fixtures. + # Determines the paths we can expect tests or specs to reside def initialize_test_layout self.model_tests_dir = "spec/models" self.controller_tests_dir = "spec/controllers" self.view_tests_dir = "spec/views" - self.fixtures_dir = "spec/fixtures" end # Given a filename and the test type, this method will return the From ea1bfe0d920d860528e4bb4b2977f286604c4687 Mon Sep 17 00:00:00 2001 From: James Herdman Date: Mon, 12 May 2008 18:23:00 -0400 Subject: [PATCH 06/16] A much more concise mapping for specs --- merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb index efa054a5..b3b767ec 100644 --- a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb +++ b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb @@ -40,8 +40,8 @@ def initialize # :nodoc: all_specs end - # Any change to a test or spec will cause it to be run - add_mapping %r%^spec/(unit|models|integration|controllers|views|functional)/.*rb$% do |filename, _| + # Changing a spec will cause it to run itself + add_mapping %r%^spec/.*\.rb$% do |filename, _| filename end From 9698f96652ca7a3c740033fc21f3ec546ede0402 Mon Sep 17 00:00:00 2001 From: James Herdman Date: Mon, 12 May 2008 18:33:36 -0400 Subject: [PATCH 07/16] Clean up helper specs and introduce a handy method for specifying the location of a given spec --- .../merb/templates/autotest/merb_rspec.rb | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb index b3b767ec..5f158e54 100644 --- a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb +++ b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb @@ -50,24 +50,15 @@ def initialize # :nodoc: model_test_for(m[1]) end - # Any change to the global helper will result in all view and controller + # Any change to global_helpers will result in all view and controller # tests being run add_mapping %r%^app/helpers/global_helpers.rb% do - files_matching %r%^spec/(views|functional|controllers)/.*_spec\.rb$% + files_matching %r%^spec/(views|controllers)/.*_spec\.rb$% end - # Any change to a helper will run it's corresponding view and controller - # tests, unless the helper is the global helper. Changes to the global - # helper run all view and controller tests. + # Any change to a helper will cause its spec to be run add_mapping %r%^app/helpers/(.*)_helper(s)?.rb% do |_, m| - if m[1] == "global" then - files_matching %r%^spec/(views|functional|controllers)/.*_spec\.rb$% - else - [ - view_test_for(m[1]), - controller_test_for(m[1]) - ] - end + spec_for(m[1], 'helper') end # Changes to views result in their corresponding view and controller test @@ -201,6 +192,22 @@ def test_for(filename, kind_of_test) # :nodoc: return name.join("_") + ".rb" end + # Generates a path to some spec given its kind and the match from a mapping + # + # ==== Arguments + # match:: the match from a mapping + # kind:: the kind of spec that the match represents + # + # ==== Returns + # String + # + # ==== Example + # > spec_for('post', :view') + # => "spec/views/post_spec.rb" + def spec_for(match, kind) + File.join("spec", kind + 's', "#{match}_spec.rb") + end + def model_test_for(filename) [model_tests_dir, test_for(filename, :model)].join("/") end From 9847e43cbca07f05c470211e6f581e01040619cd Mon Sep 17 00:00:00 2001 From: James Herdman Date: Mon, 12 May 2008 18:34:56 -0400 Subject: [PATCH 08/16] Clean up view specs mapping --- .../app_generators/merb/templates/autotest/merb_rspec.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb index 5f158e54..d0a4763e 100644 --- a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb +++ b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb @@ -61,13 +61,9 @@ def initialize # :nodoc: spec_for(m[1], 'helper') end - # Changes to views result in their corresponding view and controller test - # being run + # Changes to a view cause its spec to be run add_mapping %r%^app/views/(.*)/% do |_, m| - [ - view_test_for(m[1]), - controller_test_for(m[1]) - ] + spec_for(m[1], 'view') end # Changes to a controller result in its corresponding test being run. If From 2d74f93dec4c8f8a8b333349cc4b5700ac3d24de Mon Sep 17 00:00:00 2001 From: James Herdman Date: Mon, 12 May 2008 18:36:36 -0400 Subject: [PATCH 09/16] Clean up controller specs --- .../app_generators/merb/templates/autotest/merb_rspec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb index d0a4763e..ea27e7f9 100644 --- a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb +++ b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb @@ -66,14 +66,14 @@ def initialize # :nodoc: spec_for(m[1], 'view') end - # Changes to a controller result in its corresponding test being run. If + # Changes to a controller result in its corresponding spec being run. If # the controller is the exception or application controller, all - # controller tests are run. + # controller specs are run. add_mapping %r%^app/controllers/(.*)\.rb$% do |_, m| if ["application", "exception"].include?(m[1]) - files_matching %r%^spec/(controllers|views|functional)/.*_spec\.rb$% + files_matching %r%^spec/controllers/.*_spec\.rb$% else - controller_test_for(m[1]) + spec_for(m[1], 'controller') end end From 3d55d6cbf14b51e5052f1e9816939e6623b69675 Mon Sep 17 00:00:00 2001 From: James Herdman Date: Mon, 12 May 2008 18:42:23 -0400 Subject: [PATCH 10/16] Clean up major governing file specs --- .../app_generators/merb/templates/autotest/merb_rspec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb index ea27e7f9..e16b327e 100644 --- a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb +++ b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb @@ -77,14 +77,14 @@ def initialize # :nodoc: end end - # If a change is made to the router, run all controller and view tests - add_mapping %r%^config/router.rb$% do # FIX - files_matching %r%^spec/(controllers|views|functional)/.*_spec\.rb$% + # If a change is made to the router, run controller, view and helper specs + add_mapping %r%^config/router.rb$% do + files_matching %r%^spec/(controllers|views|helpers)/.*_spec\.rb$% end # If any of the major files governing the environment are altered, run # everything - add_mapping %r%^spec/spec_helper.rb|config/(init|rack|environments/test.rb|database.yml)% do # FIX + add_mapping %r%^config/(init|rack|environments/test).*\.rb|database\.yml)% do all_specs end end From 9f185c7ebbefdfbfa3eda21dac9ec3fd3b02f499 Mon Sep 17 00:00:00 2001 From: James Herdman Date: Mon, 12 May 2008 18:44:49 -0400 Subject: [PATCH 11/16] Some things for consistency --- .../app_generators/merb/templates/autotest/merb_rspec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb index e16b327e..ba699dd2 100644 --- a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb +++ b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb @@ -111,14 +111,14 @@ def consolidate_failures(failed) filters end - def make_test_cmd(files_to_test) + def make_test_cmd(specs_to_runs) [ ruby, "-S", spec_command, add_options_if_present, - files_to_test.keys.flatten.join(' ') - ].join(" ") + specs_to_run.keys.flatten.join(' ') + ].join(' ') end def add_options_if_present From cdd4f74290fda3fd5a3eec49aebfbb52630c2260 Mon Sep 17 00:00:00 2001 From: James Herdman Date: Mon, 12 May 2008 18:46:58 -0400 Subject: [PATCH 12/16] MerbRspec has gastric bipass --- .../merb/templates/autotest/merb_rspec.rb | 55 +------------------ 1 file changed, 1 insertion(+), 54 deletions(-) diff --git a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb index ba699dd2..e50ad233 100644 --- a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb +++ b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb @@ -10,17 +10,9 @@ class RspecCommandError < StandardError; end # will have to run your spec suite manually, or, better yet, provide your own # Autotest map explaining how your fixtures are set up. class Autotest::MerbRspec < Autotest - - # +model_tests_dir+:: the directory to find model-centric tests - # +controller_tests_dir+:: the directory to find controller-centric tests - # +view_tests_dir+:: the directory to find view-centric tests - attr_accessor :model_tests_dir, :controller_tests_dir, :view_tests_dir - def initialize # :nodoc: super - initialize_test_layout - # Ignore any happenings in these directories add_exception %r%^\./(?:doc|log|public|tmp)% @@ -47,7 +39,7 @@ def initialize # :nodoc: # Any change to a model will cause it's corresponding test to be run add_mapping %r%^app/models/(.*)\.rb$% do |_, m| - model_test_for(m[1]) + spec_for(m[1], 'model') end # Any change to global_helpers will result in all view and controller @@ -156,38 +148,6 @@ def all_specs files_matching %r%^spec/.*_spec\.rb$% end - # Determines the paths we can expect tests or specs to reside - def initialize_test_layout - self.model_tests_dir = "spec/models" - self.controller_tests_dir = "spec/controllers" - self.view_tests_dir = "spec/views" - end - - # Given a filename and the test type, this method will return the - # corresponding test's or spec's name. - # - # ==== Arguments - # +filename+:: the file name of the model, view, or controller - # +kind_of_test+:: the type of test we that we should run - # - # ==== Returns - # String:: the name of the corresponding test or spec - # - # ==== Example - # - # > test_for("user", :model) - # => "user_test.rb" - # > test_for("login", :controller) - # => "login_controller_test.rb" - # > test_for("form", :view) - # => "form_view_spec.rb" # If you're running a RSpec-like suite - def test_for(filename, kind_of_test) # :nodoc: - name = [filename] - name << kind_of_test.to_s if kind_of_test == :view - name << "spec" - return name.join("_") + ".rb" - end - # Generates a path to some spec given its kind and the match from a mapping # # ==== Arguments @@ -203,17 +163,4 @@ def test_for(filename, kind_of_test) # :nodoc: def spec_for(match, kind) File.join("spec", kind + 's', "#{match}_spec.rb") end - - def model_test_for(filename) - [model_tests_dir, test_for(filename, :model)].join("/") - end - - def controller_test_for(filename) - [controller_tests_dir, test_for(filename, :controller)].join("/") - end - - def view_test_for(filename) - [view_tests_dir, test_for(filename, :view)].join("/") - end - end From 6155e25edf7d1936b6c9dc9759af74c8e36c23da Mon Sep 17 00:00:00 2001 From: James Herdman Date: Mon, 12 May 2008 18:48:42 -0400 Subject: [PATCH 13/16] General MerbRspec clean up --- .../app_generators/merb/templates/autotest/merb_rspec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb index e50ad233..d9237df8 100644 --- a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb +++ b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb @@ -122,10 +122,10 @@ def add_options_if_present # ~/.autotest to provide a different spec command then the default # paths provided. def spec_command(separator=File::ALT_SEPARATOR) - unless defined? @spec_command then - @spec_command = spec_commands.find { |cmd| File.exists? cmd } + unless defined?(@spec_command) + @spec_command = spec_commands.find { |cmd| File.exists?(cmd) } - raise RspecCommandError, "No spec command could be found!" unless @spec_command + raise RspecCommandError, "No spec command could be found" unless @spec_command @spec_command.gsub!(File::SEPARATOR, separator) if separator end @@ -138,7 +138,7 @@ def spec_command(separator=File::ALT_SEPARATOR) # * default spec bin/loader installed in Rubygems # * any spec command found in PATH def spec_commands - [ File.join(Config::CONFIG['bindir'], 'spec'), 'spec' ] + [File.join(Config::CONFIG['bindir'], 'spec'), 'spec'] end private From 538a7c5cc0fbab14e9c8229e49b384477ade848f Mon Sep 17 00:00:00 2001 From: James Herdman Date: Mon, 12 May 2008 18:55:30 -0400 Subject: [PATCH 14/16] Clean up a few stray issues --- .../app_generators/merb/templates/autotest/merb_rspec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb index d9237df8..c94dde05 100644 --- a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb +++ b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb @@ -44,12 +44,12 @@ def initialize # :nodoc: # Any change to global_helpers will result in all view and controller # tests being run - add_mapping %r%^app/helpers/global_helpers.rb% do + add_mapping %r%^app/helpers/global_helpers\.rb% do files_matching %r%^spec/(views|controllers)/.*_spec\.rb$% end # Any change to a helper will cause its spec to be run - add_mapping %r%^app/helpers/(.*)_helper(s)?.rb% do |_, m| + add_mapping %r%^app/helpers/(.*)_helper(s)?\.rb% do |_, m| spec_for(m[1], 'helper') end @@ -76,7 +76,7 @@ def initialize # :nodoc: # If any of the major files governing the environment are altered, run # everything - add_mapping %r%^config/(init|rack|environments/test).*\.rb|database\.yml)% do + add_mapping %r%^config/(init|rack|environments/test).*\.rb|database\.yml% do all_specs end end @@ -109,7 +109,7 @@ def make_test_cmd(specs_to_runs) "-S", spec_command, add_options_if_present, - specs_to_run.keys.flatten.join(' ') + files_to_test.keys.flatten.join(' ') ].join(' ') end From 4bf10ff31b296fd246eac77b0b63f8e11d30bacb Mon Sep 17 00:00:00 2001 From: James Herdman Date: Mon, 12 May 2008 18:57:36 -0400 Subject: [PATCH 15/16] changes to the global_helpers should run every helper spec too --- merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb index c94dde05..261a7400 100644 --- a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb +++ b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb @@ -45,7 +45,7 @@ def initialize # :nodoc: # Any change to global_helpers will result in all view and controller # tests being run add_mapping %r%^app/helpers/global_helpers\.rb% do - files_matching %r%^spec/(views|controllers)/.*_spec\.rb$% + files_matching %r%^spec/(views|controllers|helpers)/.*_spec\.rb$% end # Any change to a helper will cause its spec to be run From 92d2c5359a5e5f7205497a5bb47fd3f044ca1eb7 Mon Sep 17 00:00:00 2001 From: James Herdman Date: Tue, 13 May 2008 19:20:20 -0400 Subject: [PATCH 16/16] Don't incur the wrath of Ezra --- merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb index 261a7400..6d158ef7 100644 --- a/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb +++ b/merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb @@ -10,7 +10,7 @@ class RspecCommandError < StandardError; end # will have to run your spec suite manually, or, better yet, provide your own # Autotest map explaining how your fixtures are set up. class Autotest::MerbRspec < Autotest - def initialize # :nodoc: + def initialize super # Ignore any happenings in these directories