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

File size: 856 bytes
Line 
1require 'spec_helper'
2
3if Puppet.version.to_f >= 4.5
4 describe 'test::integer', type: :class do
5 describe 'accepts integers' do
6 [
7 3,
8 '3',
9 -3,
10 '-3',
11 ].each do |value|
12 describe value.inspect do
13 let(:params) {{ value: value }}
14 it { is_expected.to compile }
15 end
16 end
17 end
18
19 describe 'rejects other values' do
20 [ true, 'true', false, 'false', 'iAmAString', '1test', '1 test', 'test 1', 'test 1 test', {}, { 'key' => 'value' }, { 1=> 2 }, '', :undef , 'x', 3.7, '3.7',-3.7, '-342.2315e-12' ].each do |value|
21 describe value.inspect do
22 let(:params) {{ value: value }}
23 it { is_expected.to compile.and_raise_error(/parameter 'value' expects a value of type Integer, Pattern(\[.*\]+)?, or Array/) }
24 end
25 end
26 end
27 end
28end
Note: See TracBrowser for help on using the repository browser.