+ context 'order =>' do
+ ['', '42', 'a', 'z'].each do |order|
+ context '\'\'' do
+ it_behaves_like 'fragment', 'motd_header', {
+ :order => order,
+ :target => '/etc/motd',
+ }
+ end
+ end
+
+ context 'false' do
+ let(:title) { 'motd_header' }
+ let(:facts) {{ :concat_basedir => '/tmp', :is_pe => false }}
+ let(:params) {{ :order => false, :target => '/etc/motd' }}
+
+ it 'should fail' do
+ expect { should }.to raise_error(Puppet::Error, /is not a string or integer/)
+ end
+ end
+
+ context '123:456' do
+ let(:title) { 'motd_header' }
+ let(:facts) {{ :concat_basedir => '/tmp', :is_pe => false }}
+ let(:params) {{ :order => '123:456', :target => '/etc/motd' }}
+
+ it 'should fail' do
+ expect { should }.to raise_error(Puppet::Error, /cannot contain/)
+ end
+ end
+ context '123/456' do
+ let(:title) { 'motd_header' }
+ let(:facts) {{ :concat_basedir => '/tmp', :is_pe => false }}
+ let(:params) {{ :order => '123/456', :target => '/etc/motd' }}
+
+ it 'should fail' do
+ expect { should }.to raise_error(Puppet::Error, /cannot contain/)
+ end
+ end
+ context '123\n456' do
+ let(:title) { 'motd_header' }
+ let(:facts) {{ :concat_basedir => '/tmp', :is_pe => false }}
+ let(:params) {{ :order => "123\n456", :target => '/etc/motd' }}
+
+ it 'should fail' do
+ expect { should }.to raise_error(Puppet::Error, /cannot contain/)
+ end
+ end
+ end # order =>
+