source: src/puppetcode/environments/test/modules/stdlib/spec/functions/getvar_spec.rb@ d43197d

debian/bullseye debian/jessie
Last change on this file since d43197d 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: 858 bytes
Line 
1require 'spec_helper'
2
3describe 'getvar' do
4 it { is_expected.not_to eq(nil) }
5 it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
6 it { is_expected.to run.with_params('one', 'two').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
7 it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
8
9 context 'given variables in namespaces' do
10 let(:pre_condition) {
11 <<-'ENDofPUPPETcode'
12 class site::data { $foo = 'baz' }
13 include site::data
14 ENDofPUPPETcode
15 }
16
17 it { is_expected.to run.with_params('site::data::foo').and_return('baz') }
18 it { is_expected.to run.with_params('::site::data::foo').and_return('baz') }
19 it { is_expected.to run.with_params('::site::data::bar').and_return(nil) }
20 end
21end
Note: See TracBrowser for help on using the repository browser.