spec/adhearsion/calls_spec.rb in adhearsion-2.1.3 vs spec/adhearsion/calls_spec.rb in adhearsion-2.2.0

- old
+ new

@@ -81,9 +81,22 @@ subject << Call.new(new_offer) << Call.new(new_offer) subject.size.should be == 2 end end + describe "when a call in the collection terminates cleanly" do + it "is removed from the collection" do + call_id = call.id + size_before = subject.size + + subject << call + call.terminate + + subject.size.should be == size_before + subject[call_id].should be_nil + end + end + describe "when a call in the collection crashes" do let(:wrapped_object) { call.wrapped_object } before do def wrapped_object.crash_me