mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 11:48:13 +01:00
28 lines
475 B
Ruby
28 lines
475 B
Ruby
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
|
|
watch(%r{src/(.+)\.py$}) do |m|
|
|
test_filename = "tests/#{m[1]}_test.py"
|
|
|
|
if File.exists?(test_filename)
|
|
run_test(test_filename)
|
|
end
|
|
end
|
|
|
|
watch(%r{tests/.+\.py$}) { |m| run_test(m[0]) }
|
|
end
|