]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Add test for python-software-properties package
authorMatthaus Litteken <matthaus@puppetlabs.com>
Fri, 24 Feb 2012 05:40:42 +0000 (21:40 -0800)
committerMatthaus Litteken <matthaus@puppetlabs.com>
Fri, 24 Feb 2012 05:40:42 +0000 (21:40 -0800)
This test adds the precondition that the python-software-packages package be
installed before the apt class is synced. If the defined function were not
called around the package resource, this test would fail with a duplicate
package resource error.

spec/classes/apt_spec.rb

index e21c78ef9a423fc4792d158b044a11dc8e02a5b2..812fa123c7d3e9165b1f9a1660bf47b2de1287aa 100644 (file)
@@ -124,4 +124,9 @@ describe 'apt', :type => :class do
       end
     end
   end
+
+  describe "it should not error if package['python-software-properties'] is already defined" do
+    let(:pre_condition) { 'package { "python-software-properties": }->Class["Apt"]' }
+    it { should contain_package("python-software-properties") }
+  end
 end