(#12094) Add rspec-puppet tests for apt
[puppet-modules/puppetlabs-apt.git] / spec / defines / builddep_spec.rb
1 require 'spec_helper'
2 describe 'apt::builddep', :type => :define do
3
4   let(:title) { 'my_package' }
5
6   describe "should succeed with a Class['apt']" do
7     let(:pre_condition) { 'class {"apt": } ' }
8
9     it { should contain_exec("apt-update-#{title}").with_command("/usr/bin/apt-get update").with_refreshonly(true) }
10   end
11
12   describe "should fail without Class['apt']" do
13     it { expect {should contain_exec("apt-update-#{title}").with_command("/usr/bin/apt-get update").with_refreshonly(true) }\
14       .to raise_error(Puppet::Error)
15     }
16   end
17
18 end