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

Last change on this file since 30903 was 30903, checked in by davidb, 7 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.6 KB
Line 
1require 'spec_helper'
2
3describe 'is_array' do
4
5 it { is_expected.not_to eq(nil) }
6 it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
7 it {
8 pending("Current implementation ignores parameters after the first.")
9 is_expected.to run.with_params([], []).and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
10 }
11 it { is_expected.to run.with_params([]).and_return(true) }
12 it { is_expected.to run.with_params(['one']).and_return(true) }
13 it { is_expected.to run.with_params([1]).and_return(true) }
14 it { is_expected.to run.with_params([{}]).and_return(true) }
15 it { is_expected.to run.with_params([[]]).and_return(true) }
16 it { is_expected.to run.with_params('').and_return(false) }
17 it { is_expected.to run.with_params('one').and_return(false) }
18 it { is_expected.to run.with_params(1).and_return(false) }
19 it { is_expected.to run.with_params({}).and_return(false) }
20 context 'Checking for deprecation warning' do
21 after(:all) do
22 ENV.delete('STDLIB_LOG_DEPRECATIONS')
23 end
24 # Checking for deprecation warning, which should only be provoked when the env variable for it is set.
25 it 'should display a single deprecation' do
26 ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
27 scope.expects(:warning).with(includes('This method is deprecated'))
28 is_expected.to run.with_params(['1.2.3.4']).and_return(true)
29 end
30 it 'should display no warning for deprecation' do
31 ENV['STDLIB_LOG_DEPRECATIONS'] = "false"
32 scope.expects(:warning).with(includes('This method is deprecated')).never
33 is_expected.to run.with_params(['1.2.3.4']).and_return(true)
34 end
35 end
36end
Note: See TracBrowser for help on using the repository browser.