Sha256: 28ca18d9b080c87718461473dee7fa3c5148461976aa4ca45d83c9d2ff2a03d5

Contents?: true

Size: 861 Bytes

Versions: 5

Compression:

Stored size: 861 Bytes

Contents

require_relative '../../spec_helper'
require_relative '../../../lib/reek/examiner'
require_relative '../../../lib/reek/report/report'

RSpec.describe Reek::Report::XMLReport do
  let(:xml_report) { Reek::Report::XMLReport.new }

  context 'empty source' do
    it 'prints empty checkstyle XML' do
      xml_report.add_examiner Reek::Examiner.new('')
      xml = "<?xml version='1.0'?>\n<checkstyle/>\n"
      expect { xml_report.show }.to output(xml).to_stdout
    end
  end

  context 'source with voliations' do
    it 'prints non-empty checkstyle XML' do
      path = SAMPLES_PATH.join('two_smelly_files/dirty_one.rb')
      xml_report.add_examiner Reek::Examiner.new(path)
      xml = SAMPLES_PATH.join('checkstyle.xml').read
      xml = xml.gsub(path.to_s, path.expand_path.to_s)
      expect { xml_report.show }.to output(xml).to_stdout
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
reek-3.4.0 spec/reek/report/xml_report_spec.rb
reek-3.3.1 spec/reek/report/xml_report_spec.rb
reek-3.3.0 spec/reek/report/xml_report_spec.rb
reek-3.2.1 spec/reek/report/xml_report_spec.rb
reek-3.2 spec/reek/report/xml_report_spec.rb