dirname_spec.rb 1.0 KB

123456789101112131415161718
  1. require 'spec_helper'
  2. describe 'dirname' 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('one', 'two').and_raise_error(Puppet::ParseError) }
  6. it { is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError) }
  7. it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError) }
  8. it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError) }
  9. it { is_expected.to run.with_params('/path/to/a/file.ext', []).and_raise_error(Puppet::ParseError) }
  10. it { is_expected.to run.with_params('/path/to/a/file.ext').and_return('/path/to/a') }
  11. it { is_expected.to run.with_params('relative_path/to/a/file.ext').and_return('relative_path/to/a') }
  12. context 'with UTF8 and double byte characters' do
  13. it { is_expected.to run.with_params('scheme:///√ạĺűē/竹.ext').and_return('scheme:///√ạĺűē') }
  14. it { is_expected.to run.with_params('ҝẽγ:/√ạĺűē/竹.ㄘ').and_return('ҝẽγ:/√ạĺűē') }
  15. end
  16. end