Merge pull request #227 from daniellawrence/file_perms_apt_ppa
[puppet-modules/puppetlabs-apt.git] / spec / defines / builddep_spec.rb
index 940c60c97b99ac6e5400e5f7bbe36c5760079910..a0cbaa4cc098e80acde84a7951788d1f64d31698 100644 (file)
@@ -1,24 +1,18 @@
 require 'spec_helper'
 describe 'apt::builddep', :type => :define do
 
+  let(:facts) { { :lsbdistid => 'Debian' } }
   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