Merge pull request #65 from branan/spec_fix
authorNan Liu <nan.liu@gmail.com>
Fri, 25 May 2012 18:26:47 +0000 (11:26 -0700)
committerNan Liu <nan.liu@gmail.com>
Fri, 25 May 2012 18:26:47 +0000 (11:26 -0700)
Fix spec tests

spec/classes/backports_spec.rb
spec/defines/pin_spec.rb
spec/defines/source_spec.rb

index efac8607553376ce57653f9ca319a429e8fef953..17e34a0e01566c4ac3bbdf5c4c05e6defa9b7ad9 100644 (file)
@@ -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',
index b5b10d702b9f32885540706a256c8b6b7b463444..bfa0126030abdddde3f8802af4ed34f531b97056 100644 (file)
@@ -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
index 110e8c21b6b5dad446fdb00d4829dea47e4df63e..ed9ce5292cb324cc9590a5d4c601e4d49036900c 100644 (file)
@@ -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]"
           })