require 'spec_helper'
describe 'apt::builddep', :type => :define do
+ let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian' } }
let(:title) { 'my_package' }
- describe "should succeed with a Class['apt']" do
- let(:pre_condition) { 'class {"apt": } ' }
-
- it { should contain_exec("apt_update").with({
- 'command' => "/usr/bin/apt-get update",
- 'refreshonly' => true
+ describe "defaults" do
+ it { should contain_exec("apt-builddep-my_package").that_requires('Exec[apt_update]').with({
+ 'command' => "/usr/bin/apt-get -y --force-yes build-dep my_package",
+ 'logoutput' => 'on_failure'
})
}
- 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