Hi,
Is there any way to have a different SOUND from growl for a ‘pass’
rather than a ‘fail’ when using “./script/autospec” ???
thanks
Hi,
Is there any way to have a different SOUND from growl for a ‘pass’
rather than a ‘fail’ when using “./script/autospec” ???
thanks
I’m not sure what platform you’re on, or if this is what you’re after,
but
the .autospec I use on the Mac uses the built in speech stuff to say
what
happens at the end of an autotest run. So, it tells me things like “all
tests passed”, or “tests passed” (depends on whether or not it ran the
full
suite, or just a changed file/spec), “some pending”, and of course
fails. I
use different voices depending on the results ![]()
On Sat, Nov 8, 2008 at 12:37 PM, Greg H. <
I’m on Mac too - so it may be as simple as changing the Growl
Preferences to get this working then?
(assuming I’m using vanilla Rspec gem).
I’ve also customised (copy/pasted from a recommendation) my
~/.autotest file. Is this an issue? Does this file actually get
used now I’m using RSpec and “./script/autospec” (as opposed to just
using ZenTest’s autotest)?
regards
Greg
Macintosh-2:myequity greg$ cat ~/.autotest
http://wincent.com/knowledge-base/Setting_up_autotest_to_use_Growl
module Autotest::Growl
AUTOTEST_IMAGE_ROOT = “~/.autotest_images”
def self.growl title, msg, img, pri=0, sticky=“”
#{msg.inspect} #{title} #{sticky}"
system “growlnotify -n autotest --image #{img} -p #{pri} -m
#{msg.inspect} #{title} #{sticky}”
end
def self.growl_fail(output)
growl “FAIL”, “#{output}”, “#{AUTOTEST_IMAGE_ROOT}/fail.png”, 2
end
def self.growl_pass(output)
growl “Pass”, “#{output}”, “#{AUTOTEST_IMAGE_ROOT}/pass.png”
end
Autotest.add_hook :ran_command do |at|
results = [at.results].flatten.join(“\n”)
if results.include? ‘tests’
output =
results.slice(/(\d+)\s+tests?,\s*(\d+)\s+assertions?,\s*(\d+)\s+failures?(,\s*(\d+)\s+errors)?/)
if output
$~[3].to_i + $~[5].to_i > 0 ? growl_fail(output) :
growl_pass(output)
end
else
output =
results.slice(/(\d+)\s+examples?,\s*(\d+)\s+failures?(,\s*(\d+)\s+not
implemented)?/)
if output
$~[2].to_i > 0 ? growl_fail(output) : growl_pass(output)
end
end
end
end
On Tue, Nov 11, 2008 at 7:51 AM, Christopher B.
On Nov 10, 2008, at 6:03 PM, Greg H. wrote:
I’m on Mac too - so it may be as simple as changing the Growl
Preferences to get this working then?
(assuming I’m using vanilla Rspec gem).
One easy way is to use qp - a command line utility for playing
QuickTIme sounds. It’s been removed from it’s original home, but you
can get it from the wayback machine:
go to Internet Archive: Digital Library of Free & Borrowable Books, Movies, Music & Wayback Machine
and search for: http://www.ed.com/qp/QP.dmg.gz
then you can use qp in the script to play a sound file based on the
event.
SR
thanks Chris - the help in .autospec · GitHub worked great
On Tue, Nov 11, 2008 at 7:51 AM, Christopher B.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs