diff options
author | Helen <helen@puppetlabs.com> | 2016-04-26 16:24:32 +0100 |
---|---|---|
committer | Helen <helen@puppetlabs.com> | 2016-04-26 16:24:32 +0100 |
commit | fc1851790554efdb39200d84bab73d08a5249be4 (patch) | |
tree | 70444106b30f5aa041014b181f7f37f2df1395c4 /spec | |
parent | 27236a73b2d6bb362f8125587a8939db562954b8 (diff) | |
parent | 19752a7ff378a35f287bf5351d466a1eae399266 (diff) |
Merge pull request #599 from hunner/fix_delete
Undo changing delete() to delete regex matches
Diffstat (limited to 'spec')
-rwxr-xr-x | spec/functions/delete_spec.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/spec/functions/delete_spec.rb b/spec/functions/delete_spec.rb index 998f9a6..cf696ac 100755 --- a/spec/functions/delete_spec.rb +++ b/spec/functions/delete_spec.rb @@ -12,8 +12,8 @@ describe 'delete' do it { is_expected.to run.with_params([], 'two').and_return([]) } it { is_expected.to run.with_params(['two'], 'two').and_return([]) } it { is_expected.to run.with_params(['two', 'two'], 'two').and_return([]) } - it { is_expected.to run.with_params(['one', 'two', 'three'], '^t.*').and_return(['one']) } it { is_expected.to run.with_params(['one', 'two', 'three'], 'four').and_return(['one', 'two', 'three']) } + it { is_expected.to run.with_params(['one', 'two', 'three'], 'e').and_return(['one', 'two', 'three']) } it { is_expected.to run.with_params(['one', 'two', 'three'], 'two').and_return(['one', 'three']) } it { is_expected.to run.with_params(['two', 'one', 'two', 'three', 'two'], 'two').and_return(['one', 'three']) } it { is_expected.to run.with_params(['one', 'two', 'three', 'two'], ['one', 'two']).and_return(['three']) } @@ -33,7 +33,7 @@ describe 'delete' do it { is_expected.to run.with_params('barfoobar', ['foo', 'barbar']).and_return('') } end - describe 'deleting from a hash' do + describe 'deleting from an array' do it { is_expected.to run.with_params({}, '').and_return({}) } it { is_expected.to run.with_params({}, 'key').and_return({}) } it { is_expected.to run.with_params({'key' => 'value'}, 'key').and_return({}) } @@ -45,10 +45,6 @@ describe 'delete' do .with_params({'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'}, ['key1', 'key2']) \ .and_return( {'key3' => 'value3'}) } - it { is_expected.to run \ - .with_params({'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'}, ['^key\d']) \ - .and_return({}) - } end it "should leave the original array intact" do |