Sha256: 3d8a63351e0957708f0721e33b016b9b2b55da7ef480e2e869771d574e8338da

Contents?: true

Size: 1.11 KB

Versions: 7

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper_system'

describe 'apt::source' do

  context 'reset' do
    it 'clean up puppetlabs repo' do
      shell('apt-key del 4BD6EC30')
      shell('rm /etc/apt/sources.list.d/puppetlabs.list')
    end
  end

  context 'apt::source' do
    it 'should work with no errors' do
      pp = <<-EOS
      include '::apt'
      apt::source { 'puppetlabs':
        location   => 'http://apt.puppetlabs.com',
        repos      => 'main',
        key        => '4BD6EC30',
        key_server => 'pgp.mit.edu',
      }
      EOS

      puppet_apply(pp) do |r|
        r.exit_code.should_not == 1
      end
    end

    describe 'key should exist' do
      it 'finds puppetlabs key' do
        shell('apt-key list | grep 4BD6EC30') do |r|
          r.exit_code.should be_zero
        end
      end
    end

    describe 'source should exist' do
      describe file('/etc/apt/sources.list.d/puppetlabs.list') do
        it { should be_file }
      end
    end
  end

  context 'reset' do
    it 'clean up puppetlabs repo' do
      shell('apt-key del 4BD6EC30')
      shell('rm /etc/apt/sources.list.d/puppetlabs.list')
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
freighthop-0.3.3 modules/apt/spec/system/apt_source_spec.rb
freighthop-0.3.2 modules/apt/spec/system/apt_source_spec.rb
freighthop-0.3.1 modules/apt/spec/system/apt_source_spec.rb
freighthop-0.3.0 modules/apt/spec/system/apt_source_spec.rb
freighthop-0.2.1 modules/apt/spec/system/apt_source_spec.rb
freighthop-0.2.0 modules/apt/spec/system/apt_source_spec.rb
freighthop-0.1.0 modules/apt/spec/system/apt_source_spec.rb