Merge pull request #241 from hunner/add_unsup
[puppet-modules/puppetlabs-apt.git] / spec / acceptance / pin_spec.rb
index 4011e73c10fbe9a62f1f1309ed28c42507c7c408..09a8d18ea1bf72521dd5169f8f2f110755123e30 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