I use autotest with rubies on rails. When I run, I have 2 passing tests. rspec spec/
; however, when I try to use autotest, this is the output:
matt@matt-laptop:~/sample_app$ autotest
loading autotest/rails_rspec2
style: RailsRspec2
matt@matt-laptop:~/sample_app$
I do not get results about test results. The same thing works with bundle exec autotest
. I saw a message recommending autospec
, but this command is deprecated with rspec2. My gemfile is
source 'http://rubygems.org'
gem 'rails', '3.0.5'
gem 'sqlite3-ruby', '1.3.2', :require => '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
I tried to put the .autotest configuration file in the root directory of my project, as well as in the home directory and do not affect the result. My .autotest file looks like this:
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(&:to_i)
if output
if failures > 0
notify "FAIL", "#{output}", "#{image_root}/fail.png"
elsif pending > 0
notify "Pending", "#{output}", "#{image_root}/pending.png"
else
notify "Pass", "#{output}", "#{image_root}/pass.png"
end
end
end
end
I also checked that libnotify-bin is installed and functioning.