(#11966) Only invoke apt-get update once.
[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").with({
10         'command' => "/usr/bin/apt-get update",
11         'refreshonly' => true
12       })
13     }
14   end
15
16   describe "should fail without Class['apt']" do
17     it { expect {should contain_exec("apt-update-#{title}").with({
18         'command' => "/usr/bin/apt-get update",
19         'refreshonly' => true
20         }).to raise_error(Puppet::Error)
21       }
22     }
23   end
24
25 end