From: Nan Liu Date: Fri, 25 May 2012 18:26:47 +0000 (-0700) Subject: Merge pull request #65 from branan/spec_fix X-Git-Tag: 0.0.4~7 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=b63b5e19bce1e27532e00bd80f1af9f57f7ea068;hp=b97cb4ae286c5753e9e4b7a39ba42d6989d2d70d;p=puppet-modules%2Fpuppetlabs-apt.git Merge pull request #65 from branan/spec_fix Fix spec tests --- diff --git a/spec/classes/backports_spec.rb b/spec/classes/backports_spec.rb index efac860..17e34a0 100644 --- a/spec/classes/backports_spec.rb +++ b/spec/classes/backports_spec.rb @@ -10,7 +10,7 @@ describe 'apt::backports', :type => :class do } end - it { should contain_apt__source('backports.list').with({ + it { should contain_apt__source('backports').with({ 'location' => 'http://old-releases.ubuntu.com/ubuntu', 'release' => 'karmic-backports', 'repos' => 'universe multiverse restricted', @@ -30,7 +30,7 @@ describe 'apt::backports', :type => :class do } end - it { should contain_apt__source('backports.list').with({ + it { should contain_apt__source('backports').with({ 'location' => 'http://backports.debian.org/debian-backports', 'release' => 'squeeze-backports', 'repos' => 'main contrib non-free', @@ -58,7 +58,7 @@ describe 'apt::backports', :type => :class do { 'location' => location } end - it { should contain_apt__source('backports.list').with({ + it { should contain_apt__source('backports').with({ 'location' => location, 'release' => 'squeeze-backports', 'repos' => 'main contrib non-free', diff --git a/spec/defines/pin_spec.rb b/spec/defines/pin_spec.rb index b5b10d7..bfa0126 100644 --- a/spec/defines/pin_spec.rb +++ b/spec/defines/pin_spec.rb @@ -40,11 +40,11 @@ describe 'apt::pin', :type => :define do it { should contain_file("#{title}.pref").with({ 'ensure' => param_hash[:ensure], - 'path' => "/etc/apt/preferences.d/#{title}", + 'path' => "/etc/apt/preferences.d/#{title}.pref", 'owner' => 'root', 'group' => 'root', 'mode' => '0644', - 'content' => "# #{title}\nPackage: #{param_hash[:packages]}\nPin: release a=#{param_hash[:release] || title}\nPin-Priority: #{param_hash[:priority]}", + 'content' => "# #{title}\nPackage: #{param_hash[:packages]}\nPin: release a=#{param_hash[:release] || title}\nPin-Priority: #{param_hash[:priority]}\n", }) } end diff --git a/spec/defines/source_spec.rb b/spec/defines/source_spec.rb index 110e8c2..ed9ce52 100644 --- a/spec/defines/source_spec.rb +++ b/spec/defines/source_spec.rb @@ -84,12 +84,12 @@ describe 'apt::source', :type => :define do it { if param_hash[:pin] - should contain_apt__pin(param_hash[:release]).with({ + should contain_apt__pin(title).with({ "priority" => param_hash[:pin], "before" => "File[#{title}.list]" }) else - should_not contain_apt__pin(param_hash[:release]).with({ + should_not contain_apt__pin(title).with({ "priority" => param_hash[:pin], "before" => "File[#{title}.list]" })