Block this from running on unsupported platforms.
[puppet-modules/puppetlabs-apt.git] / spec / acceptance / pin_spec.rb
index 6de11748d0e1f687f3c19aa2ae7c2bb251fa20f3..07fc6073022d84198b544c6dbd66bc61a74943d2 100644 (file)
@@ -91,6 +91,26 @@ describe 'apt::pin define', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfa
         it { should contain 'Pin: release a=vim-puppet' }
       end
     end
+
+    context 'array' do
+      it 'should work with no errors' do
+        pp = <<-EOS
+        include apt
+        apt::pin { 'array':
+          ensure   => present,
+          packages => ['apache', 'ntop'],
+        }
+        EOS
+
+        apply_manifest(pp, :catch_failures => true)
+      end
+
+      describe file('/etc/apt/preferences.d/array.pref') do
+        it { should be_file }
+        it { should contain 'Package: apache ntop' }
+        it { should contain 'Pin: release a=array' }
+      end
+    end
   end
 
   context 'release' do