Sha256: 61d613c210d1ef1500ef5fe8a8b0e9e702fee6e0620ccff80e2a769664e98e3a

Contents?: true

Size: 767 Bytes

Versions: 9

Compression:

Stored size: 767 Bytes

Contents

require "analysers_test_helper"
require "rubycritic/analysers/smells/flog"

describe Rubycritic::Analyser::FlogSmells do
  context "when analysing a complex file" do
    before do
      @analysed_module = AnalysedModuleDouble.new(:path => "test/samples/flog/smelly.rb", :smells => [])
      analysed_modules = [@analysed_module]
      Rubycritic::Analyser::FlogSmells.new(analysed_modules).run
    end

    it "detects its smells" do
      @analysed_module.smells.length.must_equal 1
    end

    it "creates smells with messages" do
      smell = @analysed_module.smells.first
      smell.message.must_be_instance_of String
    end

    it "creates smells with scores" do
      smell = @analysed_module.smells.first
      smell.score.must_be :>, 0
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rubycritic-2.6.0 test/lib/rubycritic/analysers/smells/flog_test.rb
rubycritic-2.5.0 test/lib/rubycritic/analysers/smells/flog_test.rb
rubycritic-2.4.1 test/lib/rubycritic/analysers/smells/flog_test.rb
rubycritic-2.4.0 test/lib/rubycritic/analysers/smells/flog_test.rb
rubycritic-2.3.0 test/lib/rubycritic/analysers/smells/flog_test.rb
rubycritic-2.2.0 test/lib/rubycritic/analysers/smells/flog_test.rb
rubycritic-2.1.0 test/lib/rubycritic/analysers/smells/flog_test.rb
rubycritic-2.0.0 test/lib/rubycritic/analysers/smells/flog_test.rb
rubycritic-1.4.0 test/lib/rubycritic/analysers/smells/flog_test.rb