diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /spec/lib/safe_zip | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/lib/safe_zip')
-rw-r--r-- | spec/lib/safe_zip/extract_spec.rb | 36 |
1 files changed, 5 insertions, 31 deletions
diff --git a/spec/lib/safe_zip/extract_spec.rb b/spec/lib/safe_zip/extract_spec.rb index 30b7e1cdd2c..443430b267d 100644 --- a/spec/lib/safe_zip/extract_spec.rb +++ b/spec/lib/safe_zip/extract_spec.rb @@ -15,11 +15,7 @@ RSpec.describe SafeZip::Extract do describe '#extract' do subject { object.extract(directories: directories, to: target_path) } - shared_examples 'extracts archive' do |param| - before do - stub_feature_flags(safezip_use_rubyzip: param) - end - + shared_examples 'extracts archive' do it 'does extract archive' do subject @@ -28,11 +24,7 @@ RSpec.describe SafeZip::Extract do end end - shared_examples 'fails to extract archive' do |param| - before do - stub_feature_flags(safezip_use_rubyzip: param) - end - + shared_examples 'fails to extract archive' do it 'does not extract archive' do expect { subject }.to raise_error(SafeZip::Extract::Error) end @@ -42,13 +34,7 @@ RSpec.describe SafeZip::Extract do context "when using #{name} archive" do let(:archive_name) { name } - context 'for RubyZip' do - it_behaves_like 'extracts archive', true - end - - context 'for UnZip' do - it_behaves_like 'extracts archive', false - end + it_behaves_like 'extracts archive' end end @@ -56,13 +42,7 @@ RSpec.describe SafeZip::Extract do context "when using #{name} archive" do let(:archive_name) { name } - context 'for RubyZip' do - it_behaves_like 'fails to extract archive', true - end - - context 'for UnZip (UNSAFE)' do - it_behaves_like 'extracts archive', false - end + it_behaves_like 'fails to extract archive' end end @@ -70,13 +50,7 @@ RSpec.describe SafeZip::Extract do let(:archive_name) { 'valid-simple.zip' } let(:directories) { %w(non/existing) } - context 'for RubyZip' do - it_behaves_like 'fails to extract archive', true - end - - context 'for UnZip' do - it_behaves_like 'fails to extract archive', false - end + it_behaves_like 'fails to extract archive' end end end |