]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/concat/spec/unit/classes/concat_setup_spec.rb
try if downgrading to 1.2.2 solves my problem
[dsa-puppet.git] / 3rdparty / modules / concat / spec / unit / classes / concat_setup_spec.rb
1 require 'spec_helper'
2
3 describe 'concat::setup', :type => :class do
4
5   shared_examples 'setup' do |concatdir|
6     concatdir = '/foo' if concatdir.nil?
7
8     let(:facts) do
9       {
10         :concat_basedir     => concatdir,
11         :caller_module_name => 'Test',
12         :osfamily           => 'Debian',
13         :id                 => 'root',
14         :is_pe              => false,
15       }
16     end
17
18     it do
19       should contain_file("#{concatdir}/bin/concatfragments.rb").with({
20         :mode   => '0755',
21         :owner  => 'root',
22         :group  => 0,
23         :source => 'puppet:///modules/concat/concatfragments.rb',
24       })
25     end
26
27     [concatdir, "#{concatdir}/bin"].each do |file|
28       it do
29         should contain_file(file).with({
30           :ensure => 'directory',
31           :mode   => '0755',
32           :owner  => 'root',
33           :group  => 0,
34         })
35       end
36     end
37   end
38
39   context 'facts' do
40     context 'concat_basedir =>' do
41       context '/foo' do
42         it_behaves_like 'setup', '/foo'
43       end
44     end
45   end # facts
46
47   context 'deprecated as a public class' do
48     it 'should create a warning' do
49       skip('rspec-puppet support for testing warning()')
50     end
51   end
52
53   context "on osfamily Solaris" do
54     concatdir = '/foo'
55     let(:facts) do
56       {
57         :concat_basedir     => concatdir,
58         :caller_module_name => 'Test',
59         :osfamily           => 'Solaris',
60         :id                 => 'root',
61         :is_pe              => false,
62       }
63     end
64
65     it do
66       should contain_file("#{concatdir}/bin/concatfragments.rb").with({
67         :ensure => 'file',
68         :owner  => 'root',
69         :group  => 0,
70         :mode   => '0755',
71         :source => 'puppet:///modules/concat/concatfragments.rb',
72       })
73     end
74   end # on osfamily Solaris
75
76   context "on osfamily windows" do
77     concatdir = '/foo'
78     let(:facts) do
79       {
80         :concat_basedir     => concatdir,
81         :caller_module_name => 'Test',
82         :osfamily           => 'windows',
83         :id                 => 'batman',
84         :is_pe              => false,
85       }
86     end
87
88     it do
89       should contain_file("#{concatdir}/bin/concatfragments.rb").with({
90         :ensure => 'file',
91         :owner  => nil,
92         :group  => nil,
93         :mode   => nil,
94         :source => 'puppet:///modules/concat/concatfragments.rb',
95       })
96     end
97   end # on osfamily windows
98 end