spec/lita/robot_spec.rb in lita-2.5.0 vs spec/lita/robot_spec.rb in lita-2.6.0

- old
+ new

@@ -7,10 +7,15 @@ allow(adapter_registry).to receive(:[]).and_return(nil) expect(Lita.logger).to receive(:fatal).with(/Unknown adapter/) expect { subject }.to raise_error(SystemExit) end + it "triggers a loaded event after initialization" do + expect_any_instance_of(described_class).to receive(:trigger).with(:loaded) + subject + end + context "with registered handlers" do let(:handler1) { double("Handler 1").as_null_object } let(:handler2) { double("Handler 2").as_null_object } before do @@ -98,9 +103,15 @@ end describe "#shut_down" do it "gracefully stops the adapter" do expect_any_instance_of(Lita::Adapters::Shell).to receive(:shut_down) + subject.shut_down + end + + it "triggers events for shut_down_started and shut_down_complete" do + expect(subject).to receive(:trigger).with(:shut_down_started).ordered + expect(subject).to receive(:trigger).with(:shut_down_complete).ordered subject.shut_down end end end