source: src/puppetcode/environments/test/modules/stdlib/spec/acceptance/suffix_spec.rb@ 501b629

debian/bullseye debian/jessie
Last change on this file since 501b629 was 1c22429, checked in by Joachim Langenbach <joachim.langenbach@…>, 10 years ago
  • gnuboat_epd adds the apt repository from gnuboat to install epd-fuse package
  • Property mode set to 100755
File size: 1.2 KB
Line 
1#! /usr/bin/env ruby -S rspec
2require 'spec_helper_acceptance'
3
4describe 'suffix function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
5 describe 'success' do
6 it 'suffixes array of values' do
7 pp = <<-EOS
8 $o = suffix(['a','b','c'],'p')
9 notice(inline_template('suffix is <%= @o.inspect %>'))
10 EOS
11
12 apply_manifest(pp, :catch_failures => true) do |r|
13 expect(r.stdout).to match(/suffix is \["ap", "bp", "cp"\]/)
14 end
15 end
16 it 'suffixs with empty array' do
17 pp = <<-EOS
18 $o = suffix([],'p')
19 notice(inline_template('suffix is <%= @o.inspect %>'))
20 EOS
21
22 apply_manifest(pp, :catch_failures => true) do |r|
23 expect(r.stdout).to match(/suffix is \[\]/)
24 end
25 end
26 it 'suffixs array of values with undef' do
27 pp = <<-EOS
28 $o = suffix(['a','b','c'], undef)
29 notice(inline_template('suffix is <%= @o.inspect %>'))
30 EOS
31
32 apply_manifest(pp, :catch_failures => true) do |r|
33 expect(r.stdout).to match(/suffix is \["a", "b", "c"\]/)
34 end
35 end
36 end
37 describe 'failure' do
38 it 'fails with no arguments'
39 it 'fails when first argument is not array'
40 it 'fails when second argument is not string'
41 end
42end
Note: See TracBrowser for help on using the repository browser.