source: other-projects/hathitrust/vagrant-hadoop-cluster/trunk/modules/stdlib/spec/functions/validate_array_spec.rb@ 30903

Last change on this file since 30903 was 30903, checked in by davidb, 8 years ago

Vagrant provisioning files for a 4-node Hadoop cluster. See README.txt for more details

  • Property svn:executable set to *
File size: 1.7 KB
Line 
1require 'spec_helper'
2
3describe 'validate_array' do
4
5 describe 'signature validation' do
6 after(:all) do
7 ENV.delete('STDLIB_LOG_DEPRECATIONS')
8 end
9 it { is_expected.not_to eq(nil) }
10 # Checking for deprecation warning
11 it 'should display a single deprecation' do
12 ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
13 scope.expects(:warning).with(includes('This method is deprecated'))
14 is_expected.to run.with_params([])
15 end
16 it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
17
18 describe 'valid inputs' do
19 it { is_expected.to run.with_params([]) }
20 it { is_expected.to run.with_params(['one']) }
21 it { is_expected.to run.with_params([], ['two']) }
22 it { is_expected.to run.with_params(['one'], ['two']) }
23 end
24
25 describe 'invalid inputs' do
26 it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /is not an Array/) }
27 it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /is not an Array/) }
28 it { is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, /is not an Array/) }
29 it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError, /is not an Array/) }
30 it { is_expected.to run.with_params([], {}).and_raise_error(Puppet::ParseError, /is not an Array/) }
31 it { is_expected.to run.with_params([], 1).and_raise_error(Puppet::ParseError, /is not an Array/) }
32 it { is_expected.to run.with_params([], true).and_raise_error(Puppet::ParseError, /is not an Array/) }
33 it { is_expected.to run.with_params([], 'one').and_raise_error(Puppet::ParseError, /is not an Array/) }
34 end
35 end
36end
37
Note: See TracBrowser for help on using the repository browser.