Sha256: d73dec379a76ecf2417819a8d6f2376ae44b641e757dc603e46e1dbce368aad9

Contents?: true

Size: 706 Bytes

Versions: 4

Compression:

Stored size: 706 Bytes

Contents

require 'spec_helper'

describe Mongo::Monitoring::Event::CommandFailed do

  let(:address) do
    Mongo::Address.new('127.0.0.1:27017')
  end

  describe '#command_name' do
    context 'when command_name is given as a string' do
      let(:event) do
        described_class.new('find', 'admin', address, 1, 2, 'Uh oh', nil, 0.5)
      end

      it 'is a string' do
        expect(event.command_name).to eql('find')
      end
    end

    context 'when command_name is given as a symbol' do
      let(:event) do
        described_class.new(:find, 'admin', address, 1, 2, 'Uh oh', nil, 0.5)
      end

      it 'is a string' do
        expect(event.command_name).to eql('find')
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mongo-2.6.4 spec/mongo/monitoring/event/command_failed_spec.rb
mongo-2.6.2 spec/mongo/monitoring/event/command_failed_spec.rb
mongo-2.6.1 spec/mongo/monitoring/event/command_failed_spec.rb
mongo-2.6.0 spec/mongo/monitoring/event/command_failed_spec.rb