Adding specs for proxy and apt::ppa
[puppet-modules/puppetlabs-apt.git] / spec / defines / builddep_spec.rb
index d60a330e0c1ad538b76e8cc39a863792711083af..4e2b698d93883b21043a0c18f9aed6e9ec9d598b 100644 (file)
@@ -3,15 +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": } ' }
-
-    it { should contain_exec("apt-update-#{title}").with_command("/usr/bin/apt-get update").with_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").with_refreshonly(true) }\
-      .to raise_error(Puppet::Error)
+  describe "should require apt-get update" do
+    it { should contain_exec("apt_update").with({
+        'command' => "/usr/bin/apt-get update",
+        'refreshonly' => true
+      })
+    }
+    it { should contain_anchor("apt::builddep::my_package").with({
+        'require' => 'Class[Apt::Update]',
+      })
     }
   end