Files
asciinema/Guardfile

28 lines
475 B
Plaintext
Raw Normal View History

2013-09-30 22:33:58 +02:00
notification :tmux, :color_location => 'status-right-bg'
def run(command)
if system(command)
n "OK", "Ble", :success
else
n "BAD", "Ble", :failed
end
nil
end
def run_test(file)
run("PYTHONPATH=tests nosetests #{file}")
end
guard 'shell' do
2013-09-30 22:33:58 +02:00
watch(%r{src/(.+)\.py$}) do |m|
test_filename = "tests/#{m[1]}_test.py"
if File.exists?(test_filename)
2013-09-30 22:33:58 +02:00
run_test(test_filename)
end
end
2013-09-30 22:33:58 +02:00
watch(%r{tests/.+\.py$}) { |m| run_test(m[0]) }
end