debian-mirror-gitlab/spec/lib/gitlab/ci/parsers/coverage/cobertura_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
632 B
Ruby
Raw Normal View History

2020-04-08 14:13:33 +05:30
# frozen_string_literal: true
2022-05-07 20:08:51 +05:30
require 'spec_helper'
2020-04-08 14:13:33 +05:30
2020-07-28 23:09:34 +05:30
RSpec.describe Gitlab::Ci::Parsers::Coverage::Cobertura do
2022-05-07 20:08:51 +05:30
let(:xml_data) { double }
let(:coverage_report) { double }
let(:project_path) { double }
let(:paths) { double }
2020-04-08 14:13:33 +05:30
2022-05-07 20:08:51 +05:30
subject(:parse_report) { described_class.new.parse!(xml_data, coverage_report, project_path: project_path, worktree_paths: paths) }
2021-02-22 17:27:13 +05:30
2022-05-07 20:08:51 +05:30
before do
allow_next_instance_of(Nokogiri::XML::SAX::Parser) do |document|
allow(document).to receive(:parse)
2020-04-08 14:13:33 +05:30
end
2022-05-07 20:08:51 +05:30
end
2020-04-08 14:13:33 +05:30
2022-05-07 20:08:51 +05:30
it 'uses Sax parser' do
expect(Gitlab::Ci::Parsers::Coverage::SaxDocument).to receive(:new)
2020-04-08 14:13:33 +05:30
2022-05-07 20:08:51 +05:30
parse_report
2020-04-08 14:13:33 +05:30
end
end