source: other-projects/hathitrust/vagrant-hadoop-cluster/trunk/modules/stdlib/spec/aliases/string_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

File size: 679 bytes
Line 
1require 'spec_helper'
2
3if Puppet.version.to_f >= 4.5
4 describe 'test::string', type: :class do
5 describe 'accepts strings' do
6 [
7 '',
8 'one',
9 nil,
10 ].each do |value|
11 describe value.inspect do
12 let(:params) {{ value: value }}
13 it { is_expected.to compile }
14 end
15 end
16 end
17
18 describe 'rejects other values' do
19 [
20 [],
21 {},
22 1,
23 true,
24 ].each do |value|
25 describe value.inspect do
26 let(:params) {{ value: value }}
27 it { is_expected.to compile.and_raise_error(/parameter 'value' expects a String/) }
28 end
29 end
30 end
31 end
32end
Note: See TracBrowser for help on using the repository browser.