summaryrefslogtreecommitdiff
path: root/spec/support/import_export/common_util.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/import_export/common_util.rb')
-rw-r--r--spec/support/import_export/common_util.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/spec/support/import_export/common_util.rb b/spec/support/import_export/common_util.rb
index 4e287f36648..1a5668946c6 100644
--- a/spec/support/import_export/common_util.rb
+++ b/spec/support/import_export/common_util.rb
@@ -38,15 +38,12 @@ module ImportExport
end
def setup_reader(reader)
- case reader
- when :legacy_reader
- allow_any_instance_of(Gitlab::ImportExport::JSON::LegacyReader::File).to receive(:exist?).and_return(true)
- allow_any_instance_of(Gitlab::ImportExport::JSON::NdjsonReader).to receive(:exist?).and_return(false)
- when :ndjson_reader
+ if reader == :ndjson_reader && Feature.enabled?(:project_import_ndjson)
allow_any_instance_of(Gitlab::ImportExport::JSON::LegacyReader::File).to receive(:exist?).and_return(false)
allow_any_instance_of(Gitlab::ImportExport::JSON::NdjsonReader).to receive(:exist?).and_return(true)
else
- raise "invalid reader #{reader}. Supported readers: :legacy_reader, :ndjson_reader"
+ allow_any_instance_of(Gitlab::ImportExport::JSON::LegacyReader::File).to receive(:exist?).and_return(true)
+ allow_any_instance_of(Gitlab::ImportExport::JSON::NdjsonReader).to receive(:exist?).and_return(false)
end
end