strip_spec.rb 2.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. require 'spec_helper'
  2. describe 'strip' do
  3. it { is_expected.not_to eq(nil) }
  4. it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) }
  5. it {
  6. pending('Current implementation ignores parameters after the first.')
  7. is_expected.to run.with_params('', '').and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i)
  8. }
  9. it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, %r{Requires either array or string to work with}) }
  10. it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, %r{Requires either array or string to work with}) }
  11. it { is_expected.to run.with_params('').and_return('') }
  12. it { is_expected.to run.with_params(' ').and_return('') }
  13. it { is_expected.to run.with_params(' ').and_return('') }
  14. it { is_expected.to run.with_params("\t").and_return('') }
  15. it { is_expected.to run.with_params("\t ").and_return('') }
  16. it { is_expected.to run.with_params('one').and_return('one') }
  17. it { is_expected.to run.with_params(' one').and_return('one') }
  18. it { is_expected.to run.with_params(' one').and_return('one') }
  19. it { is_expected.to run.with_params("\tone").and_return('one') }
  20. it { is_expected.to run.with_params("\t one").and_return('one') }
  21. it { is_expected.to run.with_params('one ').and_return('one') }
  22. it { is_expected.to run.with_params(' one ').and_return('one') }
  23. it { is_expected.to run.with_params(' one ').and_return('one') }
  24. it { is_expected.to run.with_params("\tone ").and_return('one') }
  25. it { is_expected.to run.with_params("\t one ").and_return('one') }
  26. it { is_expected.to run.with_params("one \t").and_return('one') }
  27. it { is_expected.to run.with_params(" one \t").and_return('one') }
  28. it { is_expected.to run.with_params(" one \t").and_return('one') }
  29. it { is_expected.to run.with_params("\tone \t").and_return('one') }
  30. it { is_expected.to run.with_params("\t one \t").and_return('one') }
  31. it { is_expected.to run.with_params(' o n e ').and_return('o n e') }
  32. it { is_expected.to run.with_params(' ỏŋέ ').and_return('ỏŋέ') }
  33. it { is_expected.to run.with_params(AlsoString.new(' one ')).and_return('one') }
  34. end