diff --git a/spec/unit/puppet/provider/mongodb_spec.rb b/spec/unit/puppet/provider/mongodb_spec.rb index 2145af3f8..0de3c1661 100644 --- a/spec/unit/puppet/provider/mongodb_spec.rb +++ b/spec/unit/puppet/provider/mongodb_spec.rb @@ -13,17 +13,15 @@ end describe 'mongo version detection' do - v = { - '4.x.x' => { '26' => false, '4' => true, '5' => false }, - '5.x.x' => { '26' => false, '4' => false, '5' => true }, - 'x.x.x' => { '26' => false, '4' => false, '5' => false } - } + v = [ + '4.x.x', + '5.x.x', + 'x.x.x' + ] - v.each do |key, results| + v.each do |key| it "version detection for [#{key}]" do allow(provider_class).to receive(:mongo_eval).with('db.version()').and_return(key) - expect(provider_class.mongo_4?).to be results['4'] - expect(provider_class.mongo_5?).to be results['5'] end end end