Sha256: d6fc8f4bbbf8a2d5f55eb3bc39d08171ce5d9737831f8f11129088184b7aad1d

Contents?: true

Size: 1.04 KB

Versions: 9

Compression:

Stored size: 1.04 KB

Contents

require File.join(File.dirname(File.dirname(File.dirname(File.expand_path(__FILE__)))), 'spec_helper')
require File.join(File.dirname(File.dirname(File.dirname(File.dirname(File.expand_path(__FILE__))))), 'lib', 'reek', 'examiner')
require File.join(File.dirname(File.dirname(File.dirname(File.dirname(File.expand_path(__FILE__))))), 'lib', 'reek', 'cli', 'report')

include Reek
include Reek::Cli

describe QuietReport, " when empty" do
  context 'empty source' do
    it 'has an empty quiet_report' do
      examiner = Examiner.new('')
      QuietReport.new(examiner).report.should == ''
    end
  end

  context 'with a couple of smells' do
    before :each do
      examiner = Examiner.new('def simple(a) a[3] end')
      rpt = QuietReport.new(examiner)
      @lines = rpt.report.split("\n")
    end
    it 'has a header and a list of smells' do
      @lines.should have_at_least(3).lines
    end
    it 'should mention every smell name' do
      @lines[0].should match('[Utility Function]')
      @lines[1].should match('[Feature Envy]')
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
reek-1.3.1 spec/reek/cli/report_spec.rb
reek-1.3 spec/reek/cli/report_spec.rb
reek-1.2.13 spec/reek/cli/report_spec.rb
reek-1.2.12 spec/reek/cli/report_spec.rb
reek-1.2.11 spec/reek/cli/report_spec.rb
reek-1.2.10 spec/reek/cli/report_spec.rb
reek-1.2.9 spec/reek/cli/report_spec.rb
reek-1.2.8 spec/reek/cli/report_spec.rb
reek-1.2.7.3 spec/reek/cli/report_spec.rb