diff --git a/spec/classes/server_spec.rb b/spec/classes/server_spec.rb index 0ec9f8481..70d886b7e 100644 --- a/spec/classes/server_spec.rb +++ b/spec/classes/server_spec.rb @@ -21,9 +21,6 @@ on_supported_os.each do |os, facts| context "on #{os}" do - let(:pre_condition) do - "class { 'mongodb::globals': version => '6.0.0' }" - end facts.merge({ mongodb_version: '6.0.0' }) major_version = 6 mongo_cli = if major_version >= 5 @@ -107,8 +104,8 @@ it_behaves_like 'server classes' it do - is_expected.to contain_mongodb__db('admin'). - with_user('admin'). + is_expected.to contain_mongodb__user('admin'). + with_username('admin'). with_password('password'). with_roles(%w[userAdmin readWrite dbAdmin dbAdminAnyDatabase readAnyDatabase readWriteAnyDatabase userAdminAnyDatabase clusterAdmin clusterManager diff --git a/spec/unit/mongodb_version_spec.rb b/spec/unit/mongodb_version_spec.rb index a7ede5d3d..3837a2d62 100644 --- a/spec/unit/mongodb_version_spec.rb +++ b/spec/unit/mongodb_version_spec.rb @@ -10,8 +10,8 @@ describe 'mongodb_version' do context 'with value' do before do - allow(Facter::Core::Execution).to receive(:which).with('mongo').and_return(true) - allow(Facter::Core::Execution).to receive(:execute).with('mongo --version 2>&1').and_return('MongoDB shell version: 3.2.1') + allow(Facter::Core::Execution).to receive(:which).with('mongod').and_return(true) + allow(Facter::Core::Execution).to receive(:execute).with('mongod --version 2>&1').and_return('db version: 3.2.1') end it {