Class: Minitest::Flog::Test

Inherits:
Test
  • Object
show all
Includes:
Assertions
Defined in:
lib/minitest/flog/test.rb

Constant Summary

Constants included from Assertions

Assertions::DEFAULT_FLOG_OPTIONS, Assertions::DEFAULT_METHOD_OPTIONS

Instance Attribute Summary collapse

Attributes included from Assertions

#dir, #filtered, #threshold

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Assertions

#_flog_scores_for_directory, #assert_method_score

Instance Attribute Details

#flogObject

Returns the value of attribute flog.



6
7
8
# File 'lib/minitest/flog/test.rb', line 6

def flog
  @flog
end

Class Method Details

.runnable_methodsObject



8
9
10
# File 'lib/minitest/flog/test.rb', line 8

def self.runnable_methods
  methods_matching(/^flog_/)
end

Instance Method Details

#detail_reportObject



12
13
14
15
16
17
18
19
20
# File 'lib/minitest/flog/test.rb', line 12

def detail_report
  path = File.expand_path(self.dir)
  result = "\n  #{ path }:\n"
  flog.each_by_score do |method, score, list|
    break if score < self.threshold
    result << sprintf("  %8.1f  %s\n", score, method)
  end
  result
end