Skip to content

Commit

Permalink
When Nestor detects a changed schema, we can't sendoff later because …
Browse files Browse the repository at this point in the history
…we'll already have run the tests.
  • Loading branch information
francois committed Nov 17, 2009
1 parent 129df11 commit 39d30c8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/nestor/mappers/rails/test/rails_test_unit.rb
Expand Up @@ -25,10 +25,11 @@ def sendoff(timeout=0.8, path="tmp/nestor-sendoff") #:nodoc:
end end
end end


def changed!(filename) #:nodoc: def changed!(filename, should_sendoff=true) #:nodoc:
return if File.directory?(filename) return if File.directory?(filename)
log "Detected change on #{filename.inspect}"
@machine.changed! filename @machine.changed! filename
sendoff sendoff if should_sendoff
end end


watch 'config/(?:.+)\.(?:rb|ya?ml)' do |md| watch 'config/(?:.+)\.(?:rb|ya?ml)' do |md|
Expand All @@ -46,7 +47,7 @@ def changed!(filename) #:nodoc:
watch 'db/schema.rb' do |md| watch 'db/schema.rb' do |md|
log "Detected changed schema: preparing test DB" log "Detected changed schema: preparing test DB"
system("rake db:test:prepare") system("rake db:test:prepare")
changed! md[0] changed! md[0], false
end end


# This is only to trigger the tests after a slight delay, but from the main thread. # This is only to trigger the tests after a slight delay, but from the main thread.
Expand Down

0 comments on commit 39d30c8

Please sign in to comment.