Sha256: a3043a235a281db4c501d791c5a78179d72215e166caac6fecfc64f3ad473e0d

Contents?: true

Size: 834 Bytes

Versions: 2

Compression:

Stored size: 834 Bytes

Contents

require 'spec_helper'

describe AnalDiffist::StdOutReporter do
  before do
    problems = [
      fake_problem('SomeType#foo', 1, 'A'),
      fake_problem('SomeType#foo', 2, 'B'),
      fake_problem('SomeType#bar', 3, 'C'),
      fake_problem('XXXXSomeOtherType#foobar', 4, 'D'),
    ]
    @results = AnalDiffist::StdOutReporter.new.describe(problems, :added)
  end

  it 'should have a header for the type' do
    @results.first.should == "  SomeType"
  end

  it 'should have an entry for the method' do
    @results[1].should == "    #bar"
  end

  it 'should have an entry for each problem' do
    @results[2].should == "      C"
  end

  def fake_problem(context, score, description) 
    stub('fake problem').tap {|problem| 
      problem.stub(:context) {context}
      problem.stub(:description) {description}
    }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
analdiffist-0.4.0 spec/lib/analdiffist/std_out_reporter_spec.rb
analdiffist-0.3.0 spec/lib/analdiffist/std_out_reporter_spec.rb