Sha256: 2b334eceac7bb660124be9edf6767fa9537c94a8de7f7743be7db1a170eedb40

Contents?: true

Size: 780 Bytes

Versions: 4

Compression:

Stored size: 780 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

4 entries across 4 versions & 1 rubygems

Version Path
reek-3.8.3 spec/reek/context/module_context_spec.rb
reek-3.8.2 spec/reek/context/module_context_spec.rb
reek-3.8.1 spec/reek/context/module_context_spec.rb
reek-3.8.0 spec/reek/context/module_context_spec.rb