Sha256: 99aca8c84f030e5fca492dd24d70098c9f0e2e51581ad3e7d96e71828d912b32

Contents?: true

Size: 724 Bytes

Versions: 6

Compression:

Stored size: 724 Bytes

Contents

require_relative '../../spec_helper'
require_lib 'reek/context/module_context'
require_lib 'reek/context/root_context'

RSpec.describe Reek::Context::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

RSpec.describe Reek::Context::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

6 entries across 6 versions & 1 rubygems

Version Path
reek-3.7.1 spec/reek/context/module_context_spec.rb
reek-3.7.0 spec/reek/context/module_context_spec.rb
reek-3.6.1 spec/reek/context/module_context_spec.rb
reek-3.6.0 spec/reek/context/module_context_spec.rb
reek-3.5.0 spec/reek/context/module_context_spec.rb
reek-3.4.1 spec/reek/context/module_context_spec.rb