|
6 | 6 | let(:default_charset) { %r{\A[a-zA-Z0-9]{100}\z} } |
7 | 7 |
|
8 | 8 | it { is_expected.not_to eq(nil) } |
9 | | - it { is_expected.to run.with_params.and_raise_error(ArgumentError, %r{wrong number of arguments}i) } |
10 | | - it { is_expected.to run.with_params(0).and_raise_error(ArgumentError, %r{first argument must be a positive integer}) } |
11 | | - it { is_expected.to run.with_params(1.5).and_raise_error(ArgumentError, %r{first argument must be a positive integer}) } |
12 | | - it { is_expected.to run.with_params(-10).and_raise_error(ArgumentError, %r{first argument must be a positive integer}) } |
13 | | - it { is_expected.to run.with_params('-10').and_raise_error(ArgumentError, %r{first argument must be a positive integer}) } |
14 | | - it { is_expected.to run.with_params('string').and_raise_error(ArgumentError, %r{first argument must be a positive integer}) } |
15 | | - it { is_expected.to run.with_params([]).and_raise_error(ArgumentError, %r{first argument must be a positive integer}) } |
16 | | - it { is_expected.to run.with_params({}).and_raise_error(ArgumentError, %r{first argument must be a positive integer}) } |
17 | | - it { is_expected.to run.with_params(1, 1).and_raise_error(ArgumentError, %r{second argument must be undef or a string}) } |
18 | | - it { is_expected.to run.with_params(1, []).and_raise_error(ArgumentError, %r{second argument must be undef or a string}) } |
19 | | - it { is_expected.to run.with_params(1, {}).and_raise_error(ArgumentError, %r{second argument must be undef or a string}) } |
| 9 | + it { is_expected.to run.with_params.and_raise_error(ArgumentError, %r{expects between 1 and 3 arguments, got none}i) } |
| 10 | + it { is_expected.to run.with_params(0).and_raise_error(ArgumentError, %r{parameter 'length' expects an Integer\[1\] value, got Integer\[0, 0\]}) } |
| 11 | + it { is_expected.to run.with_params(1.5).and_raise_error(ArgumentError, %r{parameter 'length' expects an Integer\ value, got Float}) } |
| 12 | + it { is_expected.to run.with_params(-10).and_raise_error(ArgumentError, %r{parameter 'length' expects an Integer\[1\] value, got Integer\[-10, -10\]}) } |
| 13 | + it { is_expected.to run.with_params('-10').and_raise_error(ArgumentError, %r{parameter 'length' expects an Integer\ value, got String}) } |
| 14 | + it { is_expected.to run.with_params('string').and_raise_error(ArgumentError, %r{parameter 'length' expects an Integer\ value, got String}) } |
| 15 | + it { is_expected.to run.with_params([]).and_raise_error(ArgumentError, %r{parameter 'length' expects an Integer value, got Array}) } |
| 16 | + it { is_expected.to run.with_params({}).and_raise_error(ArgumentError, %r{parameter 'length' expects an Integer value, got Hash}) } |
| 17 | + it { is_expected.to run.with_params(1, 1).and_raise_error(ArgumentError, %r{parameter 'charset' expects a String value, got Integer}) } |
| 18 | + it { is_expected.to run.with_params(1, []).and_raise_error(ArgumentError, %r{parameter 'charset' expects a String value, got Array}) } |
| 19 | + it { is_expected.to run.with_params(1, {}).and_raise_error(ArgumentError, %r{parameter 'charset' expects a String value, got Hash}) } |
| 20 | + it { is_expected.to run.with_params('100').and_raise_error(ArgumentError, %r{parameter 'length' expects an Integer value, got String}) } |
| 21 | + it { is_expected.to run.with_params(100, nil).and_raise_error(ArgumentError, %r{parameter 'charset' expects a String value, got Undef}) } |
20 | 22 | it { is_expected.to run.with_params(100).and_return(default_charset) } |
21 | | - it { is_expected.to run.with_params('100').and_return(default_charset) } |
22 | | - it { is_expected.to run.with_params(100, nil).and_return(default_charset) } |
23 | 23 | it { is_expected.to run.with_params(100, '').and_return(default_charset) } |
24 | 24 | it { is_expected.to run.with_params(100, 'a').and_return(%r{\Aa{100}\z}) } |
25 | 25 | it { is_expected.to run.with_params(100, 'ab').and_return(%r{\A[ab]{100}\z}) } |
|
0 commit comments