spec/adhearsion/process_spec.rb in adhearsion-2.0.0.alpha3 vs spec/adhearsion/process_spec.rb in adhearsion-2.0.0.beta1

- old
+ new

@@ -70,7 +70,25 @@ it "should stop the console" do flexmock(Console).should_receive(:stop).once Adhearsion::Process.final_shutdown end end + + it 'should handle subsequent :shutdown events in the correct order' do + Adhearsion::Process.booted + Adhearsion::Process.state_name.should be :running + Adhearsion::Process.shutdown + Adhearsion::Process.state_name.should be :stopping + Adhearsion::Process.shutdown + Adhearsion::Process.state_name.should be :rejecting + Adhearsion::Process.shutdown + Adhearsion::Process.state_name.should be :stopped + flexmock(Adhearsion::Process.instance).should_receive(:die_now!).once + Adhearsion::Process.shutdown + end + + it 'should forcibly kill the Adhearsion process on :force_stop' do + flexmock(::Process).should_receive(:exit).once.with(1) + Adhearsion::Process.force_stop + end end end