Skip to content

Commit bef05c8

Browse files
truthbkalbertvaka
authored andcommitted
[reports] manage_ruby: spec tests
1 parent 14cbdd7 commit bef05c8

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

spec/classes/datadog_agent_reports_spec.rb

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,40 @@
188188
it { is_expected.to contain_file(conf_file).without_content(%r{hostname_extraction_regex:}) }
189189
end
190190
end
191+
192+
context 'disabled ruby-manage' do
193+
let(:params) do
194+
{
195+
api_key: 'notanapikey',
196+
hostname_extraction_regex: nil,
197+
dogapi_version: 'installed',
198+
puppetmaster_user: 'puppet',
199+
puppet_gem_provider: 'gem',
200+
manage_ruby: false
201+
}
202+
end
203+
describe "datadog_agent class dogapi version override" do
204+
let(:facts) do
205+
{
206+
operatingsystem: 'Debian',
207+
osfamily: 'debian'
208+
}
209+
end
210+
211+
it { should_not contain_class('ruby').with_rubygems_update(false) }
212+
it { should_not contain_class('ruby::params') }
213+
it { should_not contain_package('ruby').with_ensure('installed') }
214+
it { should_not contain_package('rubygems').with_ensure('installed') }
215+
216+
it { should_not contain_package('ruby-dev') }
217+
218+
it { should_not contain_package('dogapi') }
219+
220+
it do
221+
should contain_file('/etc/dd-agent/datadog.yaml')\
222+
.with_owner('puppet')\
223+
.with_group('root')
224+
end
225+
end
226+
end
191227
end

0 commit comments

Comments
 (0)