Sha256: d6e169c07e8e1ac987c8ec6666d5dc6ff798d0d43c78066c00d76528904f5a32

Contents?: true

Size: 677 Bytes

Versions: 7

Compression:

Stored size: 677 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
    expect('
      module Fred
        def simple(x) x + 1; end
      end
    ').to reek_of(:UncommunicativeParameterName, /x/, /simple/)
  end

  it 'should not report module with empty class' do
    expect('# module for test
module Fred
# module for test
 class Jim; end; end').not_to reek
  end
end

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
reek-1.6.6 spec/reek/core/module_context_spec.rb
reek-1.6.5 spec/reek/core/module_context_spec.rb
reek-1.6.4 spec/reek/core/module_context_spec.rb
reek-1.6.3 spec/reek/core/module_context_spec.rb
reek-1.6.2 spec/reek/core/module_context_spec.rb
reek-1.6.1 spec/reek/core/module_context_spec.rb
reek-1.6.0 spec/reek/core/module_context_spec.rb