Sha256: b449a74edde2004551916bea023c4275eb8d523bbc865033505e9b9cdb73834d
Contents?: true
Size: 1.19 KB
Versions: 5
Compression:
Stored size: 1.19 KB
Contents
require "spec_helper" describe Lita::Adapter do let(:robot) { instance_double("Lita::Robot") } let(:required_methods) { [:join, :part, :run, :send_messages, :set_topic, :shut_down] } subject { described_class.new(robot) } it "stores a Robot" do expect(subject.robot).to eql(robot) end it "logs a warning if a required method has not been implemented" do expect(Lita.logger).to receive(:warn).exactly(required_methods.size).times required_methods.each do |method| subject.public_send(method) end end describe ".require_config" do let(:adapter_class) do Class.new(described_class) do require_config :foo require_configs :bar, :baz require_configs ["blah", :bleh] end end subject { adapter_class.new(robot) } it "ensures that config keys are present on initialization" do expect(Lita.logger).to receive(:fatal).with(/foo, bar, baz, blah, bleh/) expect { subject }.to raise_error(SystemExit) end end describe ".namespace" do it "raises an exception if self.name is not implemented" do expect do Class.new(Lita::Adapter).namespace end.to raise_error(RuntimeError) end end end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
lita-3.0.4 | spec/lita/adapter_spec.rb |
lita-3.0.3 | spec/lita/adapter_spec.rb |
lita-3.0.2 | spec/lita/adapter_spec.rb |
lita-3.0.1 | spec/lita/adapter_spec.rb |
lita-3.0.0 | spec/lita/adapter_spec.rb |