Merge branch 'fix_pin_quotes' into 1.4.x
[puppet-modules/puppetlabs-apt.git] / spec / acceptance / apt_spec.rb
index 4dbb54a0e98163b4ad9aafdeb8ec26366556ec47..775139145ec8b575543210ebb7b5e3f4e6782359 100644 (file)
@@ -1,6 +1,12 @@
 require 'spec_helper_acceptance'
 
-describe 'apt class' do
+describe 'apt class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
+
+  context 'reset' do
+    it 'fixes the sources.list' do
+      shell('cp /etc/apt/sources.list /tmp')
+    end
+  end
 
   context 'always_apt_update => true' do
     it 'should work with no errors' do
@@ -62,7 +68,7 @@ describe 'apt class' do
       pp = <<-EOS
       class { 'apt': 
         proxy_host => 'localhost',
-        proxy_port => '8080',
+        proxy_port => '7042',
       }
       EOS
 
@@ -71,7 +77,7 @@ describe 'apt class' do
 
     describe file('/etc/apt/apt.conf.d/proxy') do
       it { should be_file }
-      it { should contain 'Acquire::http::Proxy "http://localhost:8080\";' }
+      it { should contain 'Acquire::http::Proxy "http://localhost:7042\";' }
     end
   end
 
@@ -104,7 +110,7 @@ describe 'apt class' do
       pp = <<-EOS
       class { 'apt': 
         proxy_host => 'localhost',
-        proxy_port => '8080',
+        proxy_port => '7042',
       }
       EOS
 
@@ -113,7 +119,7 @@ describe 'apt class' do
 
     describe file('/etc/apt/apt.conf.d/proxy') do
       it { should be_file }
-      it { should contain 'Acquire::http::Proxy "http://localhost:8080\";' }
+      it { should contain 'Acquire::http::Proxy "http://localhost:7042\";' }
     end
   end
 
@@ -217,4 +223,11 @@ describe 'apt class' do
       end
     end
   end
+
+  context 'reset' do
+    it 'fixes the sources.list' do
+      shell('cp /tmp/sources.list /etc/apt')
+    end
+  end
+
 end