From eab22be32d53d8a82571a48124f78c745299ae9c Mon Sep 17 00:00:00 2001 From: Casey Dahlin Date: Fri, 10 Oct 2008 16:30:14 -0400 Subject: Make State#check_deps behave properly when dropping State#check_deps used to throw an exception if called for a dropping receiver. Now check_deps is a no-op on dropping states. --- state.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/state.rb b/state.rb index 56322a1..c1f6c9f 100644 --- a/state.rb +++ b/state.rb @@ -78,10 +78,13 @@ class State # Make sure our deps are satisfied, and remove ourselves from the list of # states if they aren't def check_deps + return if @status == :dropping @deps.each do |dep| dep = dep.state next if dep.status != :down - raise ConsistencyFault, "Lost dep on #{dep} without notify for #{self}" if @status != :down + unless @status == :down + raise ConsistencyFault, "Lost dep on #{dep} without notify for #{self}" + end @@states.delete self #self.methods.each{ |x| define_method(x, :"*args"){ raise ConsistencyFault, "Operation on dead state" } } self.freeze -- cgit