3 describe 'stdlib::extname' do
4 it { is_expected.not_to eq(nil) }
5 it { is_expected.to run.with_params.and_raise_error(ArgumentError, %r{'stdlib::extname' expects 1 argument, got none}) }
6 it { is_expected.to run.with_params('one', 'two').and_raise_error(ArgumentError, %r{'stdlib::extname' expects 1 argument, got 2}) }
7 it { is_expected.to run.with_params([]).and_raise_error(ArgumentError, %r{'stdlib::extname' parameter 'filename' expects a String value, got Array}) }
8 it { is_expected.to run.with_params('test.rb').and_return('.rb') }
9 it { is_expected.to run.with_params('a/b/d/test.rb').and_return('.rb') }
10 it { is_expected.to run.with_params('test').and_return('') }
11 it { is_expected.to run.with_params('.profile').and_return('') }
13 context 'with UTF8 and double byte characters' do
14 it { is_expected.to run.with_params('file_√ạĺűē/竹.rb').and_return('.rb') }