|
12 | 12 | it { is_expected.to run.with_params([], 'two').and_return([]) } |
13 | 13 | it { is_expected.to run.with_params(['two'], 'two').and_return([]) } |
14 | 14 | it { is_expected.to run.with_params(['two', 'two'], 'two').and_return([]) } |
15 | | - it { is_expected.to run.with_params(['one', 'two', 'three'], '^t.*').and_return(['one']) } |
16 | 15 | it { is_expected.to run.with_params(['one', 'two', 'three'], 'four').and_return(['one', 'two', 'three']) } |
| 16 | + it { is_expected.to run.with_params(['one', 'two', 'three'], 'e').and_return(['one', 'two', 'three']) } |
17 | 17 | it { is_expected.to run.with_params(['one', 'two', 'three'], 'two').and_return(['one', 'three']) } |
18 | 18 | it { is_expected.to run.with_params(['two', 'one', 'two', 'three', 'two'], 'two').and_return(['one', 'three']) } |
19 | 19 | it { is_expected.to run.with_params(['one', 'two', 'three', 'two'], ['one', 'two']).and_return(['three']) } |
|
33 | 33 | it { is_expected.to run.with_params('barfoobar', ['foo', 'barbar']).and_return('') } |
34 | 34 | end |
35 | 35 |
|
36 | | - describe 'deleting from a hash' do |
| 36 | + describe 'deleting from an array' do |
37 | 37 | it { is_expected.to run.with_params({}, '').and_return({}) } |
38 | 38 | it { is_expected.to run.with_params({}, 'key').and_return({}) } |
39 | 39 | it { is_expected.to run.with_params({'key' => 'value'}, 'key').and_return({}) } |
|
45 | 45 | .with_params({'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'}, ['key1', 'key2']) \ |
46 | 46 | .and_return( {'key3' => 'value3'}) |
47 | 47 | } |
48 | | - it { is_expected.to run \ |
49 | | - .with_params({'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'}, ['^key\d']) \ |
50 | | - .and_return({}) |
51 | | - } |
52 | 48 | end |
53 | 49 |
|
54 | 50 | it "should leave the original array intact" do |
|
0 commit comments