2012-01-23 22:08:00 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
describe 'apt::builddep', :type => :define do
|
|
|
|
|
|
|
|
let(:title) { 'my_package' }
|
|
|
|
|
|
|
|
describe "should succeed with a Class['apt']" do
|
|
|
|
let(:pre_condition) { 'class {"apt": } ' }
|
|
|
|
|
2012-05-04 22:35:13 +02:00
|
|
|
it { should contain_exec("apt update").with({
|
2012-02-04 02:24:09 +01:00
|
|
|
'command' => "/usr/bin/apt-get update",
|
|
|
|
'refreshonly' => true
|
|
|
|
})
|
|
|
|
}
|
2012-01-23 22:08:00 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
describe "should fail without Class['apt']" do
|
2012-02-04 02:24:09 +01:00
|
|
|
it { expect {should contain_exec("apt-update-#{title}").with({
|
|
|
|
'command' => "/usr/bin/apt-get update",
|
|
|
|
'refreshonly' => true
|
|
|
|
}).to raise_error(Puppet::Error)
|
|
|
|
}
|
2012-01-23 22:08:00 +01:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|