spec/reek/smells/data_clump_spec.rb in reek-2.0.4 vs spec/reek/smells/data_clump_spec.rb in reek-2.1.0
- old
+ new
@@ -1,8 +1,8 @@
-require 'spec_helper'
-require 'reek/smells/data_clump'
-require 'reek/smells/smell_detector_shared'
+require_relative '../../spec_helper'
+require_relative '../../../lib/reek/smells/data_clump'
+require_relative 'smell_detector_shared'
shared_examples_for 'a data clump detector' do
it 'does not report small parameter sets' do
src = <<-EOS
# test module
@@ -23,10 +23,10 @@
def first(pa, pb) @field == :sym ? 0 : 3; end
def second(pa, pb) @field == :sym; end
def third(pa, pb) pa - pb + @fred; end
end
EOS
- ctx = Reek::Core::ModuleContext.new(nil, @src.to_reek_source.syntax_tree)
+ ctx = Reek::Core::ModuleContext.new(nil, Reek::Source::SourceCode.from(@src).syntax_tree)
detector = build(:smell_detector, smell_type: :DataClump)
@smells = detector.examine_context(ctx)
end
it 'records only the one smell' do