(#14308) Add ensure=>absent for define resource.
[puppet-modules/puppetlabs-apt.git] / spec / defines / pin_spec.rb
index dbc595c568000caf7a6536356c9395fe17f3f617..c5d3fd91af03f3c159c1c25316943860e68e9e3c 100644 (file)
@@ -4,13 +4,19 @@ describe 'apt::pin', :type => :define do
 
   let :default_params do
     {
+      :ensure   => 'present',
       :packages => '*',
       :priority => '0'
     }
   end
 
-  [{},
-   {
+  [ {},
+    {
+      :packages  => 'apache',
+      :priority  => '1'
+    },
+    {
+      :ensure    => 'absent',
       :packages  => 'apache',
       :priority  => '1'
     }
@@ -27,7 +33,7 @@ describe 'apt::pin', :type => :define do
       it { should include_class("apt::params") }
 
       it { should contain_file("#{title}.pref").with({
-          'ensure'  => 'file',
+          'ensure'  => param_hash[:ensure],
           'path'    => "/etc/apt/preferences.d/#{title}",
           'owner'   => 'root',
           'group'   => 'root',