spec/lita/config_spec.rb in lita-2.7.2 vs spec/lita/config_spec.rb in lita-3.0.0
- old
+ new
@@ -46,17 +46,25 @@
described_class.load_user_config
expect(Lita.config.robot.name).to eq("Not Lita")
end
it "doesn't attempt to load lita_config.rb if it doesn't exist" do
+ allow(File).to receive(:exist?).and_return(false)
expect(described_class).not_to receive(:load)
described_class.load_user_config
end
it "raises an exception if lita_config.rb raises an exception" do
allow(File).to receive(:exist?).and_return(true)
allow(described_class).to receive(:load) { Lita.non_existent_method }
expect(Lita.logger).to receive(:fatal).with(/could not be processed/)
expect { described_class.load_user_config }.to raise_error(SystemExit)
+ end
+ end
+
+ describe "#finalize" do
+ it "freezes the configuration" do
+ subject.finalize
+ expect { subject.robot = "Assignment is impossible!" }.to raise_error(RuntimeError, /frozen/)
end
end
end