Sha256: f2a91da0933b0cf1553b453dd7c5f89fae5c7dd2e0467ea5d8e268c27ddbfd2b

Contents?: true

Size: 737 Bytes

Versions: 1

Compression:

Stored size: 737 Bytes

Contents

require_relative '../../spec_helper'
require_relative '../../../lib/reek/core/module_context'
require_relative '../../../lib/reek/core/stop_context'

describe Reek::Core::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 Reek::Core::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

1 entries across 1 versions & 1 rubygems

Version Path
reek-2.1.0 spec/reek/core/module_context_spec.rb