capitalize_spec.rb 763 B

123456789101112131415
  1. require 'spec_helper'
  2. describe 'capitalize' 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(100).and_raise_error(Puppet::ParseError) }
  6. it { is_expected.to run.with_params('one').and_return('One') }
  7. it { is_expected.to run.with_params('one two').and_return('One two') }
  8. it { is_expected.to run.with_params('ONE TWO').and_return('One two') }
  9. it { is_expected.to run.with_params(AlsoString.new('one')).and_return('One') }
  10. it { is_expected.to run.with_params([]).and_return([]) }
  11. it { is_expected.to run.with_params(%w[one two]).and_return(%w[One Two]) }
  12. it { is_expected.to run.with_params(['one', 1, 'two']).and_return(['One', 1, 'Two']) }
  13. end