Sha256: 4a29e3d816650dab0483d516a36a86dff8c50e80abcd1fa5343b492838e3c28d
Contents?: true
Size: 1.12 KB
Versions: 52
Compression:
Stored size: 1.12 KB
Contents
require 'spec_helper' describe Mongo::WriteConcern::Acknowledged do describe '#acknowledged?' do let(:concern) do described_class.new(:w => :majority) end it 'returns true' do expect(concern.acknowledged?).to be(true) end end describe '#get_last_error' do let(:get_last_error) do concern.get_last_error end context 'when the options are symbols' do let(:concern) do described_class.new(:w => :majority) end it 'converts the values to strings' do expect(get_last_error).to eq(:getlasterror => 1, :w => 'majority') end end context 'when the options are strings' do let(:concern) do described_class.new(:w => 'majority') end it 'keeps the values as strings' do expect(get_last_error).to eq(:getlasterror => 1, :w => 'majority') end end context 'when the options are numbers' do let(:concern) do described_class.new(:w => 3) end it 'keeps the values as numbers' do expect(get_last_error).to eq(:getlasterror => 1, :w => 3) end end end end
Version data entries
52 entries across 52 versions & 2 rubygems