]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Fix apt::dep spec tests.
authorNan Liu <nan@puppetlabs.com>
Wed, 9 May 2012 19:22:28 +0000 (12:22 -0700)
committerNan Liu <nan@puppetlabs.com>
Wed, 9 May 2012 19:22:28 +0000 (12:22 -0700)
Some of the existing tests were not verifying anything useful. This
update replace them with more meaningful tests.

spec/defines/builddep_spec.rb

index 940c60c97b99ac6e5400e5f7bbe36c5760079910..4e2b698d93883b21043a0c18f9aed6e9ec9d598b 100644 (file)
@@ -3,22 +3,15 @@ describe 'apt::builddep', :type => :define do
 
   let(:title) { 'my_package' }
 
-  describe "should succeed with a Class['apt']" do
-    let(:pre_condition) { 'class {"apt": } ' }
-
+  describe "should require apt-get update" do
     it { should contain_exec("apt_update").with({
         'command' => "/usr/bin/apt-get update",
         'refreshonly' => true
       })
     }
-  end
-
-  describe "should fail without Class['apt']" do
-    it { expect {should contain_exec("apt-update-#{title}").with({
-        'command' => "/usr/bin/apt-get update",
-        'refreshonly' => true
-        }).to raise_error(Puppet::Error)
-      }
+    it { should contain_anchor("apt::builddep::my_package").with({
+        'require' => 'Class[Apt::Update]',
+      })
     }
   end