1

Am working my way through Michael Hartl's Rails Tutorial and he says in Chapter 5 that one should configure Mac OS X to run auto test. The code he provides for OS X is:

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

My question is where does this file go to handle the integration? Thanks in advance.

pdenlinger
  • 3,897
  • 10
  • 60
  • 92

1 Answers1

2

Check out this part of the tutorial.

As it says, you can either put this file in the root of the project folder, or alternatively, you can save it to your user (/Users/YOURUSERNAME/) directory, this will allow it to be used in all projects. In either case, the file should be called .autotest

You will need all of this in there:

require 'autotest/fsevent'
require 'autotest/growl'

Autotest.add_hook :initialize do |autotest|
  autotest.add_mapping(/^spec\/requests\/.*_spec.rb$/) do
    autotest.files_matching(/^spec\/requests\/.*_spec\.rb$/)
  end
end
alol
  • 1,152
  • 9
  • 7