class Piggly::Tags::ConditionalBranchTag

Tracks if, catch, case branch, continue when, and exit when statements where the coverage consists of the condition evaluating true and false

Attributes

false[R]
true[R]

Public Class Methods

new(*args) click to toggle source
Calls superclass method Piggly::Tags::AbstractTag::new
# File lib/piggly/tags.rb, line 96
def initialize(*args)
  clear
  super
end

Public Instance Methods

==(other) click to toggle source
# File lib/piggly/tags.rb, line 140
def ==(other)
  @id == other.id and @true == other.true and @false == other.false
end
clear() click to toggle source
# File lib/piggly/tags.rb, line 136
def clear
  @true, @false  = false
end
complete?() click to toggle source
# File lib/piggly/tags.rb, line 120
def complete?
  @true and @false
end
description() click to toggle source
# File lib/piggly/tags.rb, line 124
def description
  if @true and @false
    "full coverage"
  elsif @true
    "never evaluates false"
  elsif @false
    "never evaluates true"
  else
    "never evaluated"
  end
end
ping(value) click to toggle source
# File lib/piggly/tags.rb, line 105
def ping(value)
  case value
  when "t"; @true  = true
  when "f"; @false = true
  end
end
style() click to toggle source
# File lib/piggly/tags.rb, line 112
def style
  "b#{@true ? 1 : 0}#{@false ? 1 : 0 }"
end
to_f() click to toggle source
# File lib/piggly/tags.rb, line 116
def to_f
  (@true and @false) ? 100.0 : (@true or @false) ? 50.0 : 0.0
end
type() click to toggle source
# File lib/piggly/tags.rb, line 101
def type
  :branch
end