Sha256: 553fade46bac213790d677b7ceafa28bdb2bf3b1ae7f70a69e7b53f1b2276056
Contents?: true
Size: 1.16 KB
Versions: 308
Compression:
Stored size: 1.16 KB
Contents
describe Appsignal::Hooks::MongoRubyDriverHook do require "appsignal/integrations/mongo_ruby_driver" context "with mongo ruby driver" do let(:subscriber) { Appsignal::Hooks::MongoMonitorSubscriber.new } before { allow(Appsignal::Hooks::MongoMonitorSubscriber).to receive(:new).and_return(subscriber) } before(:context) do module Mongo module Monitoring COMMAND = "command".freeze class Global def subscribe end end end end end after(:context) { Object.send(:remove_const, :Mongo) } describe "#dependencies_present?" do subject { described_class.new.dependencies_present? } it { is_expected.to be_truthy } end it "adds a subscriber to Mongo::Monitoring" do expect(Mongo::Monitoring::Global).to receive(:subscribe) .with("command", subscriber) .at_least(:once) Appsignal::Hooks::MongoRubyDriverHook.new.install end end context "without mongo ruby driver" do describe "#dependencies_present?" do subject { described_class.new.dependencies_present? } it { is_expected.to be_falsy } end end end
Version data entries
308 entries across 308 versions & 1 rubygems