(MODULES-1156, MODULES-769) Remove unnecessary anchors
[puppet-modules/puppetlabs-apt.git] / spec / defines / setting_spec.rb
index f39717627eb11e2b62d9f788d218fdac697ea256..6f09f9ccf084447a62838f3544eefcc4e265f587 100644 (file)
@@ -55,6 +55,21 @@ describe 'apt::setting' do
     end
   end
 
+  describe 'settings requiring settings, MODULES-769' do
+    let(:pre_condition) do
+      'class { "apt": }
+      apt::setting { "list-teddybear": content => "foo" }
+      '
+    end
+    let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy' } }
+    let(:title) { 'conf-teddybear' }
+    let(:default_params) { { :content => 'di' } }
+
+    let(:params) { default_params.merge({ :require => 'Apt::Setting[list-teddybear]' }) }
+
+    it { is_expected.to compile.with_all_deps }
+  end
+
   describe 'when trying to pull one over' do
     context 'with source and content' do
       let(:params) { default_params.merge({ :source => 'la' }) }
@@ -97,40 +112,4 @@ describe 'apt::setting' do
       :ensure => 'absent',
     })}
   end
-
-  describe 'with file_perms' do
-    context "{'owner' => 'roosevelt'}" do
-      let(:params) { default_params.merge({ :file_perms => {'owner' => 'roosevelt'} }) }
-      it { is_expected.to contain_file('/etc/apt/apt.conf.d/50teddybear').that_notifies('Exec[apt_update]').with({
-        :owner => 'roosevelt',
-        :group => 'root',
-        :mode  => '0644',
-      })}
-    end
-
-    context "'group' => 'roosevelt'}" do
-      let(:params) { default_params.merge({ :file_perms => {'group' => 'roosevelt'} }) }
-      it { is_expected.to contain_file('/etc/apt/apt.conf.d/50teddybear').that_notifies('Exec[apt_update]').with({
-        :owner => 'root',
-        :group => 'roosevelt',
-        :mode  => '0644',
-      })}
-    end
-
-    context "'owner' => 'roosevelt'}" do
-      let(:params) { default_params.merge({ :file_perms => {'mode' => '0600'} }) }
-      it { is_expected.to contain_file('/etc/apt/apt.conf.d/50teddybear').that_notifies('Exec[apt_update]').with({
-        :owner => 'root',
-        :group => 'root',
-        :mode  => '0600',
-      })}
-    end
-
-    context "'notify_update' => false}" do
-      let(:params) { default_params.merge({ :notify_update => false }) }
-      it { is_expected.to contain_file('/etc/apt/apt.conf.d/50teddybear') }
-      it { is_expected.not_to contain_file('/etc/apt/apt.conf.d/50teddybear').that_notifies('Exec[apt_update]') }
-    end
-
-  end
 end