Sha256: e36b64ff6da92d7ed8a1b9354d589a23b5f265a6301994072e26e93d7e9060b9

Contents?: true

Size: 641 Bytes

Versions: 2

Compression:

Stored size: 641 Bytes

Contents

require 'spec_helper'
require 'reek/core/module_context'
require 'reek/core/stop_context'

include Reek::Core

describe ModuleContext do
  it 'should report module name for smell in method' do
    'module Fred; def simple(x) x + 1; end; end'.should reek_of(:UncommunicativeParameterName, /x/, /simple/)
  end

  it 'should not report module with empty class' do
    '# module for test
module Fred
# module for test
 class Jim; end; end'.should_not reek
  end
end

describe ModuleContext do
  it 'should recognise global constant' do
    '# module for test
module ::Global
# module for test
 class Inside; end; end'.should_not reek
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
reek-1.3.8 spec/reek/core/module_context_spec.rb
reek-1.3.7 spec/reek/core/module_context_spec.rb