Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/shared_examples/services/base_rpm_service_shared_examples.rb')
-rw-r--r--spec/support/shared_examples/services/base_rpm_service_shared_examples.rb52
1 files changed, 0 insertions, 52 deletions
diff --git a/spec/support/shared_examples/services/base_rpm_service_shared_examples.rb b/spec/support/shared_examples/services/base_rpm_service_shared_examples.rb
deleted file mode 100644
index c9520852a5b..00000000000
--- a/spec/support/shared_examples/services/base_rpm_service_shared_examples.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-# frozen_string_literal: true
-
-RSpec.shared_examples 'handling rpm xml file' do
- include_context 'with rpm package data'
-
- let(:xml) { nil }
- let(:data) { {} }
-
- context 'when generate empty xml' do
- it 'generate expected xml' do
- expect(subject).to eq(empty_xml)
- end
- end
-
- context 'when updating existing xml' do
- let(:xml) { empty_xml }
- let(:data) { xml_update_params }
-
- shared_examples 'changing root tag attribute' do
- it "increment previous 'packages' value by 1" do
- previous_value = Nokogiri::XML(xml).at(described_class::ROOT_TAG).attributes["packages"].value.to_i
- new_value = Nokogiri::XML(subject).at(described_class::ROOT_TAG).attributes["packages"].value.to_i
-
- expect(previous_value + 1).to eq(new_value)
- end
- end
-
- it 'generate valid xml add expected xml node to existing xml' do
- # Have one root attribute
- result = Nokogiri::XML::Document.parse(subject).remove_namespaces!
- expect(result.children.count).to eq(1)
-
- # Root node has 1 child with generated node
- expect(result.xpath("//#{described_class::ROOT_TAG}/package").count).to eq(1)
- end
-
- context 'when empty xml' do
- it_behaves_like 'changing root tag attribute'
- end
-
- context 'when xml has children' do
- let(:xml) { described_class.new(xml: empty_xml, data: data).execute }
-
- it 'has children nodes' do
- result = Nokogiri::XML::Document.parse(xml).remove_namespaces!
- expect(result.children.count).to be > 0
- end
-
- it_behaves_like 'changing root tag attribute'
- end
- end
-end