Sha256: 0e7a8a762560ba234d885ac2f6676d4889eb1b3e5bf75c109538a2752612df2d

Contents?: true

Size: 761 Bytes

Versions: 8

Compression:

Stored size: 761 Bytes

Contents

require_relative '../../spec_helper'
require_relative '../../../lib/reek/context/module_context'
require_relative '../../../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

8 entries across 8 versions & 1 rubygems

Version Path
reek-3.2.1 spec/reek/context/module_context_spec.rb
reek-3.2 spec/reek/context/module_context_spec.rb
reek-3.1 spec/reek/context/module_context_spec.rb
reek-3.0.4 spec/reek/context/module_context_spec.rb
reek-3.0.3 spec/reek/context/module_context_spec.rb
reek-3.0.2 spec/reek/context/module_context_spec.rb
reek-3.0.1 spec/reek/context/module_context_spec.rb
reek-3.0.0 spec/reek/context/module_context_spec.rb