source: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/getvar_spec.rb@ 30960

Last change on this file since 30960 was 30960, checked in by davidb, 7 years ago

Switch to using Puppet to provision machine. Strongly based on files developed for spark-hdfs cluster

  • Property svn:executable set to *
File size: 925 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 it { is_expected.to run.with_params('$::foo').and_return(nil) }
10
11 context 'given variables in namespaces' do
12 let(:pre_condition) {
13 <<-'ENDofPUPPETcode'
14 class site::data { $foo = 'baz' }
15 include site::data
16 ENDofPUPPETcode
17 }
18
19 it { is_expected.to run.with_params('site::data::foo').and_return('baz') }
20 it { is_expected.to run.with_params('::site::data::foo').and_return('baz') }
21 it { is_expected.to run.with_params('::site::data::bar').and_return(nil) }
22 end
23end
Note: See TracBrowser for help on using the repository browser.