Add missing new files from commit 131e09855e06
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / type_aliases / string_spec.rb
1 require 'spec_helper'
2
3 if Puppet::Util::Package.versioncmp(Puppet.version, '4.5.0') >= 0
4   describe 'Stdlib::Compat::String' do
5     describe 'accepts strings' do
6       [
7         '',
8         'one',
9         nil,
10       ].each do |value|
11         describe value.inspect do
12           it { is_expected.to allow_value(value) }
13         end
14       end
15     end
16
17     describe 'rejects other values' do
18       [
19         [],
20         {},
21         1,
22         true,
23       ].each do |value|
24         describe value.inspect do
25           it { is_expected.not_to allow_value(value) }
26         end
27       end
28     end
29   end
30 end