Sha256: 3a0f7765d796edd6d006b6b2d0fbc82d2b14071da2ec9e891ed63d3ab068c450

Contents?: true

Size: 668 Bytes

Versions: 4

Compression:

Stored size: 668 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper.rb'

require 'reek/method_checker'
require 'reek/report'

include Reek

describe MethodChecker, "(Utility Function)" do

  before(:each) do
    @rpt = Report.new
    @cchk = MethodChecker.new(@rpt, 'Thing')
  end

  it 'should not report instance variable reference' do
    @cchk.check_source('def simple(arga) @yellow end')
    @rpt.should be_empty
  end

  it 'should not report vcall' do
    @cchk.check_source('def simple(arga) y end')
    @rpt.should be_empty
  end

  it 'should not report attrset' do
    class Fred
      attr_writer :xyz
    end
    @cchk.check_object(Fred)
    @rpt.should be_empty
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
reek-0.0.1 spec/reek/utility_function_spec.rb
reek-0.1.0 spec/reek/utility_function_spec.rb
reek-0.1.1 spec/reek/utility_function_spec.rb
reek-0.2.0 spec/reek/utility_function_spec.rb