source: src/puppetcode/environments/test/modules/stdlib/spec/acceptance/loadyaml_spec.rb@ 5519ced

0.5 app-cordova debian/bullseye debian/jessie
Last change on this file since 5519ced 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 100644
File size: 1.1 KB
Line 
1#! /usr/bin/env ruby -S rspec
2require 'spec_helper_acceptance'
3
4tmpdir = default.tmpdir('stdlib')
5
6describe 'loadyaml function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
7 describe 'success' do
8 it 'loadyamls array of values' do
9 shell("echo '---
10 aaa: 1
11 bbb: 2
12 ccc: 3
13 ddd: 4' > #{tmpdir}/testyaml.yaml")
14 pp = <<-EOS
15 $o = loadyaml('#{tmpdir}/testyaml.yaml')
16 notice(inline_template('loadyaml[aaa] is <%= @o["aaa"].inspect %>'))
17 notice(inline_template('loadyaml[bbb] is <%= @o["bbb"].inspect %>'))
18 notice(inline_template('loadyaml[ccc] is <%= @o["ccc"].inspect %>'))
19 notice(inline_template('loadyaml[ddd] is <%= @o["ddd"].inspect %>'))
20 EOS
21
22 apply_manifest(pp, :catch_failures => true) do |r|
23 expect(r.stdout).to match(/loadyaml\[aaa\] is 1/)
24 expect(r.stdout).to match(/loadyaml\[bbb\] is 2/)
25 expect(r.stdout).to match(/loadyaml\[ccc\] is 3/)
26 expect(r.stdout).to match(/loadyaml\[ddd\] is 4/)
27 end
28 end
29 end
30 describe 'failure' do
31 it 'fails with no arguments'
32 end
33end
Note: See TracBrowser for help on using the repository browser.