Sha256: 78032b2ab32874c47cdaf78fe626f8e231f8aa6875e8ce0a6e9df6cf3b34fdcd

Contents?: true

Size: 815 Bytes

Versions: 17

Compression:

Stored size: 815 Bytes

Contents

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

require 'reek/code_parser'
require 'reek/report'

include Reek

describe CodeParser, "with no method definitions" do
  it 'should report no problems for empty source code' do
    ''.should_not reek
  end
  it 'should report no problems for empty class' do
    'class Fred; end'.should_not reek
  end
end

describe CodeParser, 'with a global method definition' do
  it 'should report no problems for simple method' do
    'def Outermost::fred() true; end'.should_not reek
  end
end

describe CodeParser, 'when a yield is the receiver' do
  it 'should report no problems' do
    source = 'def values(*args)
  @to_sql += case
    when block_given? then " #{yield.to_sql}"
    else " values (#{args.to_sql})"
  end
  self
end'
    source.should_not reek
  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
kevinrutherford-reek-1.1.1 spec/reek/code_parser_spec.rb
kevinrutherford-reek-1.1.2.1 spec/reek/code_parser_spec.rb
kevinrutherford-reek-1.1.2 spec/reek/code_parser_spec.rb
kevinrutherford-reek-1.1.3.1 spec/reek/code_parser_spec.rb
kevinrutherford-reek-1.1.3.10 spec/reek/code_parser_spec.rb
kevinrutherford-reek-1.1.3.2 spec/reek/code_parser_spec.rb
kevinrutherford-reek-1.1.3.3 spec/reek/code_parser_spec.rb
kevinrutherford-reek-1.1.3.4 spec/reek/code_parser_spec.rb
kevinrutherford-reek-1.1.3.5 spec/reek/code_parser_spec.rb
kevinrutherford-reek-1.1.3.6 spec/reek/code_parser_spec.rb
kevinrutherford-reek-1.1.3.7 spec/reek/code_parser_spec.rb
kevinrutherford-reek-1.1.3.8 spec/reek/code_parser_spec.rb
kevinrutherford-reek-1.1.3.9 spec/reek/code_parser_spec.rb
kevinrutherford-reek-1.1.3 spec/reek/code_parser_spec.rb
teksymmetry-reek-1.1.3.1 spec/reek/code_parser_spec.rb
teksymmetry-reek-1.1.3.2 spec/reek/code_parser_spec.rb
reek-1.1.3 spec/reek/code_parser_spec.rb