Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / functions / abs_spec.rb
1 require 'spec_helper'
2 if Puppet::Util::Package.versioncmp(Puppet.version, '6.0.0') < 0
3   describe 'abs' do
4     it { is_expected.not_to eq(nil) }
5
6     describe 'signature validation in puppet3', :unless => RSpec.configuration.puppet_future do
7       it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) }
8       it {
9         pending('Current implementation ignores parameters after the first.')
10         is_expected.to run.with_params(1, 2).and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i)
11       }
12     end
13
14     describe 'signature validation in puppet4', :if => RSpec.configuration.puppet_future do
15       it {
16         pending 'the puppet 6 implementation'
17         is_expected.to run.with_params.and_raise_error(ArgumentError)
18       }
19       it {
20         pending 'the puppet 6 implementation'
21         is_expected.to run.with_params(1, 2).and_raise_error(ArgumentError)
22       }
23       it {
24         pending 'the puppet 6 implementation'
25         is_expected.to run.with_params([]).and_raise_error(ArgumentError)
26       }
27       it {
28         pending 'the puppet 6 implementation'
29         is_expected.to run.with_params({}).and_raise_error(ArgumentError)
30       }
31       it {
32         pending 'the puppet 6 implementation'
33         is_expected.to run.with_params(true).and_raise_error(ArgumentError)
34       }
35     end
36
37     it { is_expected.to run.with_params(-34).and_return(34) }
38     it { is_expected.to run.with_params('-34').and_return(34) }
39     it { is_expected.to run.with_params(34).and_return(34) }
40     it { is_expected.to run.with_params('34').and_return(34) }
41     it { is_expected.to run.with_params(-34.5).and_return(34.5) }
42     it { is_expected.to run.with_params('-34.5').and_return(34.5) }
43     it { is_expected.to run.with_params(34.5).and_return(34.5) }
44     it { is_expected.to run.with_params('34.5').and_return(34.5) }
45   end
46 end