Sha256: a2c4d4c6ff60cb4774169687fbe9523051a4d587bee9e04a02f8a7e70969f4fe

Contents?: true

Size: 792 Bytes

Versions: 20

Compression:

Stored size: 792 Bytes

Contents

require_relative '../../spec_helper'
require_lib 'reek/examiner'
require_lib 'reek/report/xml_report'

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

  context 'with an 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 'with a source with violations' do
    it 'prints non-empty checkstyle XML' do
      xml_report.add_examiner Reek::Examiner.new(SMELLY_FILE)
      xml = SAMPLES_DIR.join('checkstyle.xml').read
      xml = xml.gsub(SMELLY_FILE.to_s, SMELLY_FILE.expand_path.to_s)
      expect { xml_report.show }.to output(xml).to_stdout
    end
  end
end

Version data entries

20 entries across 18 versions & 2 rubygems

Version Path
reek-6.0.3 spec/reek/report/xml_report_spec.rb
reek-6.0.2 spec/reek/report/xml_report_spec.rb
reek-6.0.1 spec/reek/report/xml_report_spec.rb
reek-6.0.0 spec/reek/report/xml_report_spec.rb
reek-5.6.0 spec/reek/report/xml_report_spec.rb
reek-5.5.0 spec/reek/report/xml_report_spec.rb
reek-5.4.1 spec/reek/report/xml_report_spec.rb
reek-5.4.0 spec/reek/report/xml_report_spec.rb
reek-5.3.2 spec/reek/report/xml_report_spec.rb
reek-5.3.1 spec/reek/report/xml_report_spec.rb
reek-5.3.0 spec/reek/report/xml_report_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/report/xml_report_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/report/xml_report_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/report/xml_report_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/report/xml_report_spec.rb
reek-5.2.0 spec/reek/report/xml_report_spec.rb
reek-5.1.0 spec/reek/report/xml_report_spec.rb
reek-5.0.2 spec/reek/report/xml_report_spec.rb
reek-5.0.1 spec/reek/report/xml_report_spec.rb
reek-5.0.0 spec/reek/report/xml_report_spec.rb