Sha256: 19fa6c290fe555a52c4cc34524350ebffbc49f2cee033d9c92e85c647c5b234e

Contents?: true

Size: 937 Bytes

Versions: 9

Compression:

Stored size: 937 Bytes

Contents

require File.join(File.dirname(File.dirname(File.dirname(File.expand_path(__FILE__)))), 'spec_helper')
require File.join(File.dirname(File.dirname(File.dirname(File.dirname(File.expand_path(__FILE__))))), 'lib', 'reek', 'core', 'module_context')
require File.join(File.dirname(File.dirname(File.dirname(File.dirname(File.expand_path(__FILE__))))), 'lib', 'reek', 'core', 'stop_context')

include Reek::Core

describe ModuleContext do
  it 'should report module name for smell in method' do
    'module Fred; def simple(x) true; end; end'.should reek_of(:UncommunicativeParameterName, /x/, /simple/)
  end

  it 'should not report module with empty class' do
    '# module for test
module Fred
# module for test
 class Jim; end; end'.should_not reek
  end
end

describe ModuleContext do
  it 'should recognise global constant' do
    '# module for test
module ::Global
# module for test
 class Inside; end; end'.should_not reek
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
reek-1.3.1 spec/reek/core/module_context_spec.rb
reek-1.3 spec/reek/core/module_context_spec.rb
reek-1.2.13 spec/reek/core/module_context_spec.rb
reek-1.2.12 spec/reek/core/module_context_spec.rb
reek-1.2.11 spec/reek/core/module_context_spec.rb
reek-1.2.10 spec/reek/core/module_context_spec.rb
reek-1.2.9 spec/reek/core/module_context_spec.rb
reek-1.2.8 spec/reek/core/module_context_spec.rb
reek-1.2.7.3 spec/reek/core/module_context_spec.rb