X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fdefines%2Fconf_spec.rb;h=a7db4e61e3f54ffed20db74884cf93ef63304525;hb=c57d2dd5ddafe26bd17727ab184b00fb8a166a2a;hp=5a81b5148c7d7bf489dabdef47012abe8d58a995;hpb=a840dd8372d8a89dd0dab0f8b41ade29a77761da;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/defines/conf_spec.rb b/spec/defines/conf_spec.rb index 5a81b51..a7db4e6 100644 --- a/spec/defines/conf_spec.rb +++ b/spec/defines/conf_spec.rb @@ -1,5 +1,9 @@ require 'spec_helper' describe 'apt::conf', :type => :define do + let :pre_condition do + 'class { "apt": }' + end + let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy' } } let :title do 'norecommends' end @@ -16,15 +20,9 @@ describe 'apt::conf', :type => :define do "/etc/apt/apt.conf.d/00norecommends" end - it { should contain_apt__conf('norecommends').with({ - 'priority' => '00', - 'content' => "Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;\n" - }) - } - - it { should contain_file(filename).with({ + it { is_expected.to contain_file(filename).with({ 'ensure' => 'present', - 'content' => "Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;\n", + 'content' => /Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;/, 'owner' => 'root', 'group' => 'root', 'mode' => '0644', @@ -45,9 +43,9 @@ describe 'apt::conf', :type => :define do "/etc/apt/apt.conf.d/00norecommends" end - it { should contain_file(filename).with({ + it { is_expected.to contain_file(filename).with({ 'ensure' => 'absent', - 'content' => "Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;\n", + 'content' => /Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;/, 'owner' => 'root', 'group' => 'root', 'mode' => '0644',