spec/celluloid/supervisor_spec.rb in celluloid-0.15.2 vs spec/celluloid/supervisor_spec.rb in celluloid-0.16.0.pre

- old
+ new

@@ -1,8 +1,8 @@ require 'spec_helper' -describe Celluloid::Supervisor do +describe Celluloid::Supervisor, actor_system: :global do class SubordinateDead < StandardError; end class Subordinate include Celluloid attr_reader :state @@ -86,7 +86,18 @@ subordinate.should_not be_alive new_subordinate = supervisor.actors.first new_subordinate.should_not eq subordinate new_subordinate.state.should be(:working) + end + + it "removes an actor if it terminates cleanly" do + supervisor = Subordinate.supervise(:working) + subordinate = supervisor.actors.first + + supervisor.actors.should == [subordinate] + + subordinate.terminate + + supervisor.actors.should be_empty end end