Permalink
Browse files

When Nestor detects a changed schema, we can't sendoff later because …

…we'll already have run the tests.
  • Loading branch information...
1 parent 129df11 commit 39d30c8f3f462d77bb61de8838b690bcae93f24c @francois committed Nov 17, 2009
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/nestor/mappers/rails/test/rails_test_unit.rb
View
7 lib/nestor/mappers/rails/test/rails_test_unit.rb
@@ -25,10 +25,11 @@ def sendoff(timeout=0.8, path="tmp/nestor-sendoff") #:nodoc:
end
end
-def changed!(filename) #:nodoc:
+def changed!(filename, should_sendoff=true) #:nodoc:
return if File.directory?(filename)
+ log "Detected change on #{filename.inspect}"
@machine.changed! filename
- sendoff
+ sendoff if should_sendoff
end
watch 'config/(?:.+)\.(?:rb|ya?ml)' do |md|
@@ -46,7 +47,7 @@ def changed!(filename) #:nodoc:
watch 'db/schema.rb' do |md|
log "Detected changed schema: preparing test DB"
system("rake db:test:prepare")
- changed! md[0]
+ changed! md[0], false
end
# This is only to trigger the tests after a slight delay, but from the main thread.

0 comments on commit 39d30c8

Please sign in to comment.