Class: DeepCover::Analyser::Ruby25LikeBranch

Inherits:
DeepCover::Analyser show all
Includes:
Subset
Defined in:
lib/deep_cover/analyser/ruby25_like_branch.rb

Defined Under Namespace

Classes: NodeCoverageExtrator

Constant Summary collapse

SUBSET_CLASSES =
[Node::Case, Node::Csend, Node::If, Node::ShortCircuit,
 Node::Until, Node::UntilPost, Node::While, Node::WhilePost,
].freeze

Instance Attribute Summary

Attributes included from Base

#options, #source

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Subset

#node_children

Methods included from Base

#covered_code, #each_node, #node_children, #node_covered?, #node_runs, #node_runs_map, #node_stat_contributions, #node_stat_type, #stats

Methods included from Tools::Covered

#covered?

Constructor Details

#initialize(*args) ⇒ Ruby25LikeBranch

Returns a new instance of Ruby25LikeBranch.



15
16
17
18
# File 'lib/deep_cover/analyser/ruby25_like_branch.rb', line 15

def initialize(*args)
  super
  @loc_index = 0
end

Class Method Details

.human_nameObject



7
8
9
# File 'lib/deep_cover/analyser/ruby25_like_branch.rb', line 7

def self.human_name
  'Ruby25 branches'
end

Instance Method Details

#resultsObject



20
21
22
23
24
25
# File 'lib/deep_cover/analyser/ruby25_like_branch.rb', line 20

def results
  extractor = NodeCoverageExtrator.new
  each_node.map do |node|
    extractor.branch_coverage(node)
  end.to_h
end