From: Nan Liu Date: Wed, 9 May 2012 19:22:28 +0000 (-0700) Subject: Fix apt::dep spec tests. X-Git-Tag: 0.0.4~13^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=2ce47f065222ddf7adcd13aeb42f138130dac11c;p=puppet-modules%2Fpuppetlabs-apt.git Fix apt::dep spec tests. Some of the existing tests were not verifying anything useful. This update replace them with more meaningful tests. --- diff --git a/spec/defines/builddep_spec.rb b/spec/defines/builddep_spec.rb index 940c60c..4e2b698 100644 --- a/spec/defines/builddep_spec.rb +++ b/spec/defines/builddep_spec.rb @@ -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