Sha256: cbbe89079776081339eb0ceaacba9ea72ebd42f5c211ab42e4244db3b326c0a0
Contents?: true
Size: 1.33 KB
Versions: 2
Compression:
Stored size: 1.33 KB
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/, /Fred/) 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 context 'full_name' do it "reports full context" do element = StopContext.new element = ModuleContext.new(element, 'mod', s(:module, :mod, nil)) element.full_name.should == 'mod' end end it 'finds fq loaded class' do exp = [:class, :"Reek::Smells::LargeClass", nil] ctx = StopContext.new res = ModuleContext.resolve(exp[1], ctx) res[1].should == "LargeClass" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
reek-1.2.7.1 | spec/reek/core/module_context_spec.rb |
reek-1.2.7 | spec/reek/core/module_context_spec.rb |