summaryrefslogtreecommitdiff
path: root/files/puppet/modules/pixelated/spec/classes/apt_spec.rb
blob: 102f65803a4d8d57447fdcef89bd31850dc5ff07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
require 'spec_helper'

describe 'pixelated::apt' do
  let(:facts) do
      {
        :operatingsystem => 'Debian',
        :lsbdistid       => 'Debian',
        :domain          => 'default',
        :lsbdistcodename => 'jessie',
      }
  end

  let(:pre_condition) { [
    "class apt {}",
    "define apt::sources_list($content='deb url') {}",
  ] }

  it { should contain_apt__sources_list('pixelated.list').
    with_content("deb [arch=amd64] http://packages.pixelated-project.org/debian jessie main\n") }
  it { should contain_file('/srv/leap/0x287A1542472DC0E3_packages@pixelated-project.org.asc') }
  it { should contain_exec('add_pixelated_key') }

  context 'staging' do
    let(:facts) do
        {
          :domain          => 'staging.pixelated-project.org',
          :lsbdistcodename => 'jessie',
        }
    end

    it { should contain_apt__sources_list('pixelated.list').
      with_content("deb [arch=amd64] http://packages.pixelated-project.org/debian jessie-snapshots main\n") }
  end

  context 'unstable' do
    let(:facts) do
        {
          :domain          => 'unstable.pixelated-project.org',
          :lsbdistcodename => 'jessie',
        }
    end

    it { should contain_apt__sources_list('pixelated.list').
      with_content("deb [arch=amd64] http://packages.pixelated-project.org/debian jessie-snapshots main\n") }
  end

  context 'vagrant' do
    let(:facts) do
        {
          :domain          => 'pixelated-project.local',
          :lsbdistcodename => 'jessie',
        }
    end

    it { should contain_apt__sources_list('pixelated.list').
      with_content("deb [arch=amd64] http://packages.pixelated-project.org/debian jessie-snapshots main\n") }
  end
end