Sha256: c2abc1de60ca435f81a6a4e181916be2ed58f97d8e5286eb30196f7ace112062

Contents?: true

Size: 706 Bytes

Versions: 3

Compression:

Stored size: 706 Bytes

Contents

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

describe Rubycritic::Analyser::FlogSmells do
  before do
    @analysed_file = AnalysedFileDouble.new(:path => "test/samples/flog/smelly.rb", :smells => [])
    analysed_files = [@analysed_file]
    Rubycritic::Analyser::FlogSmells.new(analysed_files).run
  end

  it "detects smells and adds them to analysed_files" do
    @analysed_file.smells.length.must_equal 1
  end

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

  it "creates smells with scores" do
    smell = @analysed_file.smells.first
    smell.score.must_be_kind_of Numeric
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubycritic-1.0.2 test/lib/rubycritic/analysers/smells/flog_test.rb
rubycritic-1.0.1 test/lib/rubycritic/analysers/smells/flog_test.rb
rubycritic-1.0.0 test/lib/rubycritic/analysers/smells/flog_test.rb