Sha256: bd378c3c41bbc1d7ab30d7786c5e1c5bb78eb3f93ce4cb55f0631a9ebb8bd5b6
Contents?: true
Size: 1.42 KB
Versions: 5
Compression:
Stored size: 1.42 KB
Contents
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper') require 'json' describe Slather::CoverageService::CoberturaXmlOutput do let(:fixtures_project) do proj = Slather::Project.open(FIXTURES_PROJECT_PATH) proj.extend(Slather::CoverageService::CoberturaXmlOutput) end describe '#coverage_file_class' do it "should return CoverageFile" do expect(fixtures_project.send(:coverage_file_class)).to eq(Slather::CoverageFile) end end describe '#post' do it "should create an XML report spanning all coverage files" do fixtures_project.post file = File.open(FIXTURES_XML_PATH) fixture_xml_doc = Nokogiri::XML(file) file.close file = File.open('cobertura.xml') current_xml_doc = Nokogiri::XML(file) file.close current_xml_doc.root['timestamp'] = '' current_xml_doc.root['version'] = '' source_node = current_xml_doc.at_css "source" source_node.content = '' expect(current_xml_doc.to_xml).to eq(fixture_xml_doc.to_xml) File.unlink('cobertura.xml') end it "should create an XML report in the given output directory" do fixtures_project.output_directory = "./output" fixtures_project.post filepath = "#{fixtures_project.output_directory}/cobertura.xml" expect(File.exists?(filepath)).to be_truthy FileUtils.rm_rf(fixtures_project.output_directory) end end end
Version data entries
5 entries across 5 versions & 1 rubygems