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', 'smells', 'data_clump') require File.join(File.dirname(File.expand_path(__FILE__)), 'smell_detector_shared') include Reek::Smells shared_examples_for 'a data clump detector' do it 'does not report small parameter sets' do src = < 3, DataClump::PARAMETERS_KEY => ['pa', 'pb']}) end it 'reports 3 identical parameter sets in a class' do src = < 3, DataClump::PARAMETERS_KEY => ['pa', 'pb', 'pc']}) end it 'reports re-ordered identical parameter sets' do src = < 3, DataClump::PARAMETERS_KEY => ['pa', 'pb', 'pc']}) end it 'counts only identical parameter sets' do src = < 5) end end describe DataClump do before(:each) do @detector = DataClump.new('newt') end it_should_behave_like 'SmellDetector' context 'in a class' do before :each do @context = 'class' end it_should_behave_like 'a data clump detector' end context 'in a module' do before :each do @context = 'module' end it_should_behave_like 'a data clump detector' end # TODO: include singleton methods in the calcs end