Sha256: ea3c05df2ef06668cdeb6dc233c8ed721fedc177d469703733e7ad70bf166c8a

Contents?: true

Size: 692 Bytes

Versions: 5

Compression:

Stored size: 692 Bytes

Contents

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

RSpec.describe Reek::Report::HTMLReport do
  let(:instance) { Reek::Report::HTMLReport.new }

  context 'with an empty source' do
    let(:examiner) { Reek::Examiner.new('') }

    before do
      instance.add_examiner examiner
    end

    it 'has the text 0 total warnings' do
      tempfile = Tempfile.new(['Reek::Report::HTMLReport.', '.html'])
      response = "HTML file saved\n"
      expect { instance.show tempfile.path }.to output(response).to_stdout
      expect(tempfile.read).to include('0 total warnings')
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
reek-3.3.0 spec/reek/report/html_report_spec.rb
reek-3.2.1 spec/reek/report/html_report_spec.rb
reek-3.2 spec/reek/report/html_report_spec.rb
reek-3.1 spec/reek/report/html_report_spec.rb
reek-3.0.4 spec/reek/report/html_report_spec.rb