flatten_spec.rb 993 B

123456789101112131415
  1. require 'spec_helper'
  2. describe 'flatten', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do
  3. it { is_expected.not_to eq(nil) }
  4. it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError) }
  5. it { is_expected.to run.with_params([], []).and_raise_error(Puppet::ParseError) }
  6. it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError) }
  7. it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError) }
  8. it { is_expected.to run.with_params([]).and_return([]) }
  9. it { is_expected.to run.with_params(['one']).and_return(['one']) }
  10. it { is_expected.to run.with_params([['one']]).and_return(['one']) }
  11. it { is_expected.to run.with_params(%w[a b c d e f g]).and_return(%w[a b c d e f g]) }
  12. it { is_expected.to run.with_params([['a', 'b', ['c', %w[d e], 'f', 'g']]]).and_return(%w[a b c d e f g]) }
  13. it { is_expected.to run.with_params(['ã', 'β', ['ĉ', %w[đ ẽ ƒ ġ]]]).and_return(%w[ã β ĉ đ ẽ ƒ ġ]) }
  14. end