File: command_started_spec.rb

package info (click to toggle)
ruby-mongo 2.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,332 kB
  • sloc: ruby: 45,579; makefile: 5
file content (26 lines) | stat: -rw-r--r-- 529 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
require 'spec_helper'

describe Mongo::Monitoring::Event::CommandStarted do

  describe '#initialize' do

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

    let(:command) do
      BSON::Document.new(test: 'value')
    end

    context 'when the command should be redacted' do

      let(:event) do
        described_class.new('copydb', 'admin', address, 1, 2, command)
      end

      it 'sets the command to an empty document' do
        expect(event.command).to be_empty
      end
    end
  end
end