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