Browse Source

Missed the - for -y, but also tests were missing lsbdistid

Hunter Haugen 10 years ago
parent
commit
8453d40138
3 changed files with 16 additions and 7 deletions
  1. 1 0
      Gemfile
  2. 2 2
      manifests/params.pp
  3. 13 5
      spec/defines/ppa_spec.rb

+ 1 - 0
Gemfile

@@ -2,6 +2,7 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org'
 
 group :development, :test do
   gem 'rake',                    :require => false
+  gem 'pry',                     :require => false
   gem 'rspec-puppet',            :require => false
   gem 'puppet-lint',             :require => false
   gem 'puppetlabs_spec_helper',  :require => false

+ 2 - 2
manifests/params.pp

@@ -23,7 +23,7 @@ class apt::params {
       case $::lsbdistcodename {
         'hardy','maverick','natty','oneiric','precise': {
           $backports_location = 'http://us.archive.ubuntu.com/ubuntu'
-          $ppa_options = 'y'
+          $ppa_options = '-y'
         }
         'lucid': {
           $backports_location = 'http://us.archive.ubuntu.com/ubuntu'
@@ -31,7 +31,7 @@ class apt::params {
         }
         default: {
           $backports_location = 'http://old-releases.ubuntu.com/ubuntu'
-          $ppa_options = 'y'
+          $ppa_options = '-y'
         }
       }
     }

+ 13 - 5
spec/defines/ppa_spec.rb

@@ -1,20 +1,28 @@
 require 'spec_helper'
 describe 'apt::ppa', :type => :define do
-  [ { :lsbdistrelease => '11.04',
+  [
+    {
+      :lsbdistrelease  => '11.04',
       :lsbdistcodename => 'natty',
       :operatingsystem => 'Ubuntu',
-      :package => 'python-software-properties'},
-    { :lsbdistrelease => '12.10',
+      :lsbdistid       => 'Ubuntu',
+      :package         => 'python-software-properties'
+    },
+    {
+      :lsbdistrelease  => '12.10',
       :lsbdistcodename => 'quantal',
       :operatingsystem => 'Ubuntu',
-      :package => 'software-properties-common'},
+      :lsbdistid       => 'Ubuntu',
+      :package         => 'software-properties-common'
+    },
   ].each do |platform|
     context "on #{platform[:lsbdistcodename]}" do
       let :facts do
         {
-          :lsbdistrelease => platform[:lsbdistrelease],
+          :lsbdistrelease  => platform[:lsbdistrelease],
           :lsbdistcodename => platform[:lsbdistcodename],
           :operatingsystem => platform[:operatingsystem],
+          :lsbdistid       => platform[:lsbdistid],
         }
       end
       let :release do