Convert to use apt::setting instead of file resources
[puppet-modules/puppetlabs-apt.git] / spec / defines / conf_spec.rb
index 91b6d4e62fbf10a1268c74acb9d77f3441bc7f8a..4e5b46b8247c07b465a4b026761c6c7eff166d9a 100644 (file)
@@ -1,5 +1,8 @@
 require 'spec_helper'
 describe 'apt::conf', :type => :define do
+  let :pre_condition do
+    'class { "apt": }'
+  end
   let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian' } }
   let :title do
     'norecommends'
@@ -17,7 +20,7 @@ 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'    => 'present',
           'content'   => /Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;/,
           'owner'     => 'root',
@@ -40,7 +43,7 @@ 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;/,
         'owner'     => 'root',