Skip to content

Commit

Permalink
MODULES-2269: Add tests for apt::conf notify_update
Browse files Browse the repository at this point in the history
Ensure that proper rspec tests exist for notify_update
  • Loading branch information
Brett Delle Grazie committed Aug 15, 2015
1 parent 9195209 commit 67777b6
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion spec/defines/conf_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
end

describe "when creating an apt preference" do
let :params do
let :default_params do
{
:priority => '00',
:content => "Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;\n"
}
end
let :params do
default_params
end

let :filename do
"/etc/apt/apt.conf.d/00norecommends"
Expand All @@ -28,6 +31,22 @@
'mode' => '0644',
})
}

context "with notify_update = true (default)" do
let :params do
default_params
end
it { is_expected.to contain_apt__setting("conf-#{title}").with_notify_update(true) }
end

context "with notify_update = false" do
let :params do
default_params.merge({
:notify_update => false
})
end
it { is_expected.to contain_apt__setting("conf-#{title}").with_notify_update(false) }
end
end

describe "when creating a preference without content" do
Expand Down

0 comments on commit 67777b6

Please sign in to comment.