X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fdefines%2Fhold_spec.rb;h=60b991f194f347a86154cf663234707c203eb433;hb=5d7982dba0e6c5f31f320ebc2466a1811d283d51;hp=9da21d784a9b634016bd49e3a2cebee9a2a94d08;hpb=ce846d0118b4220a7f71307f089cb65b37dcccda;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/defines/hold_spec.rb b/spec/defines/hold_spec.rb index 9da21d7..60b991f 100644 --- a/spec/defines/hold_spec.rb +++ b/spec/defines/hold_spec.rb @@ -1,9 +1,9 @@ require 'spec_helper' describe 'apt::hold' do let :facts do { - :osfamily => 'Debian', - :lsbdistid => 'Debian', - :lsbrelease => 'wheezy', + :osfamily => 'Debian', + :lsbdistid => 'Debian', + :lsbrelease => 'wheezy', } end let :title do @@ -18,13 +18,6 @@ describe 'apt::hold' do let :params do default_params end it 'creates an apt preferences file' do - should contain_apt__hold(title).with({ - :ensure => 'present', - :package => title, - :version => params[:version], - :priority => 1001, - }) - should contain_apt__pin("hold_#{title}").with({ :ensure => 'present', :packages => title, @@ -38,9 +31,6 @@ describe 'apt::hold' do let :params do default_params.merge({:ensure => 'absent',}) end it 'creates an apt preferences file' do - should contain_apt__hold(title).with({ - :ensure => params[:ensure], - }) should contain_apt__pin("hold_#{title}").with({ :ensure => params[:ensure], @@ -52,22 +42,29 @@ describe 'apt::hold' do let :params do default_params.merge({:priority => 990,}) end it 'creates an apt preferences file' do - should contain_apt__hold(title).with({ + should contain_apt__pin("hold_#{title}").with({ :ensure => 'present', - :package => title, + :packages => title, :version => params[:version], :priority => params[:priority], }) + end + end - should contain_apt__pin("hold_#{title}").with({ + describe 'package => foo' do + let :params do default_params.merge({:package => 'foo'}) end + + it 'creates an apt preferences file' do + should contain_apt__pin("hold_foo").with({ :ensure => 'present', - :packages => title, + :packages => 'foo', :version => params[:version], - :priority => params[:priority], + :priority => 1001, }) end end + describe 'validation' do context 'version => {}' do let :params do { :version => {}, } end