spec/slow/redcloth_spec.rb in kevinrutherford-reek-1.1.3.9 vs spec/slow/redcloth_spec.rb in kevinrutherford-reek-1.1.3.10
- old
+ new
@@ -1,10 +1,14 @@
require File.dirname(__FILE__) + '/../spec_helper.rb'
+require 'reek/report'
+
+include Reek
+
describe 'sample gem source code' do
it "reports the correct smells in redcloth.rb" do
- ruby = File.new("#{SAMPLES_DIR}/redcloth.rb").to_source
+ ruby = File.new("#{SAMPLES_DIR}/redcloth.rb").sniff
ruby.should reek_of(:ControlCouple, /RedCloth#blocks\/block/, /deep_code/)
ruby.should reek_of(:ControlCouple, /RedCloth#check_refs/, /text/)
ruby.should reek_of(:ControlCouple, /RedCloth#pba/, /text_in/)
ruby.should reek_of(:ControlCouple, /RedCloth#textile_bq/, /atts/)
ruby.should reek_of(:ControlCouple, /RedCloth#textile_bq/, /cite/)
@@ -94,8 +98,8 @@
ruby.should reek_of(:UtilityFunction, /RedCloth#h_align/)
ruby.should reek_of(:UtilityFunction, /RedCloth#htmlesc/)
ruby.should reek_of(:UtilityFunction, /RedCloth#incoming_entities/)
ruby.should reek_of(:UtilityFunction, /RedCloth#no_textile/)
ruby.should reek_of(:UtilityFunction, /RedCloth#v_align/)
- ruby.report.should have_at_most(93).smells
+ Report.new(ruby).length.should == 93
end
end