Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor manage_repo install tests for consistency. #165

Merged
merged 1 commit into from
Mar 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 4 additions & 27 deletions spec/classes/telegraf_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,14 @@
when 'RedHat'
is_expected.to contain_yumrepo('influxdata').that_comes_before('Package[telegraf]')
is_expected.to contain_package('telegraf')
when 'windows'
is_expected.to compile.with_all_deps
is_expected.to contain_package('telegraf')
end
end
end

describe 'do not manage repo on debian' do
describe 'do not manage repo' do
let(:pre_condition) do
[
'class {"telegraf": manage_repo => false}',
Expand All @@ -237,36 +240,10 @@
is_expected.to compile.with_all_deps
is_expected.to contain_package('telegraf')
is_expected.not_to contain_apt__source('influxdata')
end
end
end

describe 'do not manage repo on RedHat' do
let(:pre_condition) do
[
'class {"telegraf": manage_repo => false}',
]
end

it do
case facts[:osfamily]
when 'RedHat'
is_expected.to compile.with_all_deps
is_expected.to contain_package('telegraf')
is_expected.not_to contain_yumrepo('influxdata')
end
end
end

describe 'do not manage repo on windows' do
let(:pre_condition) do
[
'class {"telegraf": manage_repo => false}'
]
end

it do
case facts[:osfamily]
when 'windows'
is_expected.to compile.with_all_deps
is_expected.to contain_package('telegraf')
Expand Down