spec/lita/config_spec.rb in lita-1.1.2 vs spec/lita/config_spec.rb in lita-2.0.0
- old
+ new
@@ -14,11 +14,27 @@
expect(subject.foo).to eql(value)
end
describe ".default_config" do
it "has predefined values for certain keys" do
- expect(described_class.default_config.robot.name).to eq("Lita")
- expect(described_class.default_config.robot.adapter).to eq(:shell)
+ default_config = described_class.default_config
+ expect(default_config.robot.name).to eq("Lita")
+ expect(default_config.robot.adapter).to eq(:shell)
+ end
+
+ it "loads configuration from registered handlers" do
+ handler = Class.new(Lita::Handler) do
+ def self.default_config(handler_config)
+ handler_config.bar = :baz
+ end
+
+ def self.name
+ "Lita::Handlers::Foo"
+ end
+ end
+ allow(Lita).to receive(:handlers).and_return([handler])
+ default_config = described_class.default_config
+ expect(default_config.handlers.foo.bar).to eq(:baz)
end
end
describe ".load_user_config" do
it "loads and evals lita_config.rb" do