Sha256: 7718906e387070f0b21f5ab0cab1e1e07a757a5ef497a01003de756dbffebb96

Contents?: true

Size: 584 Bytes

Versions: 14

Compression:

Stored size: 584 Bytes

Contents

def run(cmd)
  puts(cmd)
  system(cmd)
end

def run_test_file(file)
  run "ruby -Itest #{file}"
end

def run_all_tests
  run "rake test"
end

def related_test_files(path)
  Dir['test/**/*.rb'].select { |file| file =~ /#{File.basename(path)}/ }
end

watch('test/test_helper\.rb') { run_all_tests }
watch('test/.*/test_.*\.rb')  { |m| run_test_file(m[0]) }
watch('lib/.*') do |m|
  related_test_files(m[0]).each { |file| run_test_file(file) }
end

# Ctrl-\
Signal.trap('QUIT') do
  puts " --- Running all tests ---\n\n"
  run_all_tests
end

# Ctrl-C
Signal.trap('INT') { abort("\n") }

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
djsun-mongo_mapper-0.5.5.3 specs.watchr
mongo_mapper-unstable-2009.10.16 specs.watchr
djsun-mongo_mapper-0.5.5.2 specs.watchr
mongo_mapper-0.5.5 specs.watchr
mongo_mapper-unstable-2009.10.12 specs.watchr
djsun-mongo_mapper-0.5.4.1 specs.watchr
djsun-mongo_mapper-0.5.3.1 specs.watchr
mongo_mapper-0.5.4 specs.watchr
mongo_mapper-0.5.3 specs.watchr
mongo_mapper-unstable-2009.10.11 specs.watchr
djsun-mongo_mapper-0.5.2.1 specs.watchr
mongo_mapper-0.5.2 specs.watchr
djsun-mongo_mapper-0.5.0.1 specs.watchr
mongo_mapper-0.5.1 specs.watchr