title: Autotest ruby on rails with rspec
body: <p>I'm using autotest with ruby on rails. I have passing 2 passing tests when I run. <code>rspec spec/</code>; however, when I try to use autotest this is the output:</p>
  
  <pre><code>matt@matt-laptop:~/sample_app$ autotest
  loading autotest/rails_rspec2
  style: RailsRspec2
  matt@matt-laptop:~/sample_app$
  </code></pre>
  
  <p>I get no output about the results of the tests. The same thing works with <code>bundle exec autotest</code>. I saw a post recommending <code>autospec</code> but that command is deprecated with rspec2. My Gemfile is </p>
  
  <pre><code>source 'http://rubygems.org'
  
  gem 'rails', '3.0.5'
  gem 'sqlite3-ruby', '1.3.2', :require =&gt; 'sqlite3'
  
  group :development do
    gem 'rspec-rails', '2.5.0'
    gem 'autotest','4.4.4'
  end
  
  group :test do
    gem 'rspec', '2.5.0'
    gem 'webrat', '0.7.1'
    gem 'autotest', '4.4.4'
    gem 'redgreen', '1.2.2'
  end
  </code></pre>
  
  <p>I have tried putting the .autotest config file in the root directory of my project as well as the home directory and neither makes a difference on the output. My .autotest file looks like this </p>
  
  <pre><code>#!/bin/ruby
  require 'autotest/timestamp'
  
  module Autotest::GnomeNotify
    def self.notify title, msg, img
      system "notify-send '#{title}' '#{msg}' -i #{img} -t 3000"
    end
  
    Autotest.add_hook :ran_command do |at|
      image_root = "~/.autotest_images"
      results = [at.results].flatten.join("\n")
      results.gsub!(/\\e\[\d+m/,'')
      output = results.slice(/(\d+)\sexamples?,\s(\d+)\sfailures?(,\s(\d+)\spending?|)/)
      full_sentence, green, failures, garbage, pending = $~.to_a.map(&amp;:to_i)
    if output
      if failures &gt; 0
        notify "FAIL", "#{output}", "#{image_root}/fail.png"
      elsif pending &gt; 0
        notify "Pending", "#{output}", "#{image_root}/pending.png"
      else
        notify "Pass", "#{output}", "#{image_root}/pass.png"
      end
    end
   end
  end
  </code></pre>
  
  <p>I've also checked that libnotify-bin is installed and functioning.</p>