Sha256: a2254af326d925c8035c552e4b24db38590d3eb569e4410d74c13c9462f5d3c6

Contents?: true

Size: 674 Bytes

Versions: 5

Compression:

Stored size: 674 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,  name: 'x')
  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

5 entries across 5 versions & 1 rubygems

Version Path
reek-2.0.4 spec/reek/core/module_context_spec.rb
reek-2.0.3 spec/reek/core/module_context_spec.rb
reek-2.0.2 spec/reek/core/module_context_spec.rb
reek-2.0.1 spec/reek/core/module_context_spec.rb
reek-2.0.0 spec/reek/core/module_context_spec.rb