Update stdlib
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / functions / abs_spec.rb
1 require 'spec_helper'
2
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, /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, /wrong number of arguments/i)
11     }
12   end
13
14   describe 'signature validation in puppet4', :if => RSpec.configuration.puppet_future do
15     it { pending "the puppet 4 implementation"; is_expected.to run.with_params().and_raise_error(ArgumentError) }
16     it { pending "the puppet 4 implementation"; is_expected.to run.with_params(1, 2).and_raise_error(ArgumentError) }
17     it { pending "the puppet 4 implementation"; is_expected.to run.with_params([]).and_raise_error(ArgumentError) }
18     it { pending "the puppet 4 implementation"; is_expected.to run.with_params({}).and_raise_error(ArgumentError) }
19     it { pending "the puppet 4 implementation"; is_expected.to run.with_params(true).and_raise_error(ArgumentError) }
20   end
21
22   it { is_expected.to run.with_params(-34).and_return(34) }
23   it { is_expected.to run.with_params("-34").and_return(34) }
24   it { is_expected.to run.with_params(34).and_return(34) }
25   it { is_expected.to run.with_params("34").and_return(34) }
26   it { is_expected.to run.with_params(-34.5).and_return(34.5) }
27   it { is_expected.to run.with_params("-34.5").and_return(34.5) }
28   it { is_expected.to run.with_params(34.5).and_return(34.5) }
29   it { is_expected.to run.with_params("34.5").and_return(34.5) }
30 end