class DeepCover::Node::Case
Public Instance Methods
branches()
click to toggle source
# File lib/deep_cover/node/case.rb, line 88 def branches whens.map(&:body) << self.else end
branches_summary(of_branches)
click to toggle source
# File lib/deep_cover/node/case.rb, line 92 def branches_summary(of_branches) texts = [] n = of_branches.size if of_branches.include? self.else texts << "#{'implicit ' unless has_else?}else" n -= 1 end texts.unshift "#{n} when clause#{'s' if n > 1}" if n > 0 texts.join(' and ') end
execution_count()
click to toggle source
# File lib/deep_cover/node/case.rb, line 103 def execution_count return evaluate.flow_completion_count if evaluate flow_entry_count end
has_else?()
click to toggle source
# File lib/deep_cover/node/case.rb, line 108 def has_else? !!base_node.loc.to_hash[:else] end