Limit Integration tests run by autotest (Rails)

I'm using autotest, and have added hooks to run my integration tests. While working, any time I make a change that impacts any of the integration tests, all the integration tests rerun. This is the behavior I'd like to change, if possible. (I'm using rspec with webrat for my tests, no cucumber)

With non-integration tests, the pattern is that it reruns the tests in the same spec file (or describe block?) if you change the test or what its describing. So, say we have page_controller.rb and page_controller_spec.rb. autotest knows that if you change one of those files, it runs just the tests in the page_controller_spec, then, if it passes, it runs all the tests. I'd like something similar for my integration tests -- just run the tests in the file with the failing test first, then run all tests if they pass.

my .autotest file looks like this

require "autotest/growl"
require "autotest/fsevent"

Autotest.add_hook :initialize do |autotest|
  autotest.add_mapping(/^spec\/integration\/.*_spec\.rb$/) do
    autotest.files_matching(/^spec\/integration\/.*_spec\.rb$/)
  end  
end

Answers


Your .autotest is the source of the problem :) It basically says that for any file in /spec/integration directory, all of them should be run. You should return only the matched filename, like this:

require "autotest/growl"
require "autotest/fsevent"

Autotest.add_hook :initialize do |autotest|
  autotest.add_mapping(/^spec\/integration\/.*_spec\.rb$/) do |filename|
    filename
  end  
end

Need Your Help

Google Maps API - Problems with class GLatLngBounds

javascript google-maps

I am having some trouble with the Google Maps API. I have an array which holds a ojbect I created to store points.

How to save a 2-Dimensional array to a file in C?

c arrays file-io viola-jones

I am an beginner C programmer and I am currently working on a project to implement viola jones object detection algorithm using C. I would like to know how I would be able to store data in a

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.