Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (28 sloc) 0.686 kb
def run_spec(file)
unless File.exist?(file)
puts "#{file} does not exist"
return
end
puts "Running #{file}"
system "bundle exec rspec #{file}"
puts
end
watch("spec/.*/*_spec.rb") do |match|
run_spec match[0]
end
def related_test_files(path)
Dir.glob "spec/**/#{File.basename(path, File.extname(path))}_spec.rb"
end
watch('lib/.*') do |m|
system('clear')
if files = related_test_files(m[0]) and !files.empty?
puts "bundle exec rspec #{files.join(" ")}"
system "bundle exec rspec #{files.join(" ")}"
end
end
Signal.trap('QUIT') do
puts " --- Running all tests ---\n\n"
system "bundle exec rake"
end
# Ctrl-C
Signal.trap('INT') { abort("\n") }
Jump to Line
Something went wrong with that request. Please try again.