/usr/share/puppet/modules.available/puppetlabs-mongodb/spec/defines/db_spec.rb is in puppet-module-puppetlabs-mongodb 0.7.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | require 'spec_helper'
describe 'mongodb::db', :type => :define do
let(:title) { 'testdb' }
let(:params) {
{ 'user' => 'testuser',
'password' => 'testpass',
}
}
it 'should contain mongodb_database with mongodb::server requirement' do
should contain_mongodb_database('testdb')\
.with_require('Class[Mongodb::Server]')
end
it 'should contain mongodb_user with mongodb_database requirement' do
should contain_mongodb_user('testuser')\
.with_require('Mongodb_database[testdb]')
end
it 'should contain mongodb_user with proper database name' do
should contain_mongodb_user('testuser')\
.with_database('testdb')
end
it 'should contain mongodb_user with proper roles' do
params.merge!({'roles' => ['testrole1', 'testrole2']})
should contain_mongodb_user('testuser')\
.with_roles(["testrole1", "testrole2"])
end
it 'should prefer password_hash instead of password' do
params.merge!({'password_hash' => 'securehash'})
should contain_mongodb_user('testuser')\
.with_password_hash('securehash')
end
it 'should contain mongodb_database with proper tries param' do
params.merge!({'tries' => 5})
should contain_mongodb_database('testdb').with_tries(5)
end
end
|