abs_spec.rb 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. require 'spec_helper'
  2. describe 'abs' do
  3. it { is_expected.not_to eq(nil) }
  4. describe 'signature validation in puppet3', :unless => RSpec.configuration.puppet_future do
  5. it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) }
  6. it {
  7. pending('Current implementation ignores parameters after the first.')
  8. is_expected.to run.with_params(1, 2).and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i)
  9. }
  10. end
  11. describe 'signature validation in puppet4', :if => RSpec.configuration.puppet_future do
  12. it {
  13. pending 'the puppet 4 implementation'
  14. is_expected.to run.with_params.and_raise_error(ArgumentError)
  15. }
  16. it {
  17. pending 'the puppet 4 implementation'
  18. is_expected.to run.with_params(1, 2).and_raise_error(ArgumentError)
  19. }
  20. it {
  21. pending 'the puppet 4 implementation'
  22. is_expected.to run.with_params([]).and_raise_error(ArgumentError)
  23. }
  24. it {
  25. pending 'the puppet 4 implementation'
  26. is_expected.to run.with_params({}).and_raise_error(ArgumentError)
  27. }
  28. it {
  29. pending 'the puppet 4 implementation'
  30. is_expected.to run.with_params(true).and_raise_error(ArgumentError)
  31. }
  32. end
  33. it { is_expected.to run.with_params(-34).and_return(34) }
  34. it { is_expected.to run.with_params('-34').and_return(34) }
  35. it { is_expected.to run.with_params(34).and_return(34) }
  36. it { is_expected.to run.with_params('34').and_return(34) }
  37. it { is_expected.to run.with_params(-34.5).and_return(34.5) }
  38. it { is_expected.to run.with_params('-34.5').and_return(34.5) }
  39. it { is_expected.to run.with_params(34.5).and_return(34.5) }
  40. it { is_expected.to run.with_params('34.5').and_return(34.5) }
  41. end