Class: Chibineko::TestItem

Inherits:
Object
  • Object
show all
Defined in:
lib/chibineko/testitem.rb

Constant Summary collapse

GROUP_DEPTH =
5
STATUS_OK =
["OK","Passed"]
STATUS_PENDING =
["保留","Deferred"]
STATUS_FAIL =
["NG","Failed"]
STATUS_NOT_EXEC =
["未実施","Not started"]
STATUS_SKIP =
["対象外","N/A"]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(row, src, line_num = -1)) ⇒ TestItem

Returns a new instance of TestItem.


16
17
18
19
20
21
22
23
24
25
26
# File 'lib/chibineko/testitem.rb', line 16

def initialize(row, src, line_num = -1)
  self.memo= row.field(-1)
  self.status= row.field(-2)
  self.item= row.field(-3)
  self.groups= GROUP_DEPTH.times.map {|offset|
    group = row.field('-', offset)
    (group.nil? or group.empty?) ? nil : group
  }
  self.source= src
  self.line=line_num
end

Instance Attribute Details

#groupsObject

Returns the value of attribute groups


14
15
16
# File 'lib/chibineko/testitem.rb', line 14

def groups
  @groups
end

#itemObject

Returns the value of attribute item


14
15
16
# File 'lib/chibineko/testitem.rb', line 14

def item
  @item
end

#lineObject

Returns the value of attribute line


14
15
16
# File 'lib/chibineko/testitem.rb', line 14

def line
  @line
end

#memoObject

Returns the value of attribute memo


14
15
16
# File 'lib/chibineko/testitem.rb', line 14

def memo
  @memo
end

#sourceObject

Returns the value of attribute source


14
15
16
# File 'lib/chibineko/testitem.rb', line 14

def source
  @source
end

#statusObject

Returns the value of attribute status


14
15
16
# File 'lib/chibineko/testitem.rb', line 14

def status
  @status
end

Instance Method Details

#execute?Boolean

Returns:

  • (Boolean)

33
34
35
# File 'lib/chibineko/testitem.rb', line 33

def execute?
  ok? or ng?
end

#locationObject


42
43
44
# File 'lib/chibineko/testitem.rb', line 42

def location
  source + "#" + line
end

#ng?Boolean

Returns:

  • (Boolean)

30
31
32
# File 'lib/chibineko/testitem.rb', line 30

def ng?
  STATUS_FAIL.include?(status)
end

#ok?Boolean

Returns:

  • (Boolean)

27
28
29
# File 'lib/chibineko/testitem.rb', line 27

def ok?
  STATUS_OK.include?(status)
end

#pending?Boolean

Returns:

  • (Boolean)

39
40
41
# File 'lib/chibineko/testitem.rb', line 39

def pending?
  STATUS_PENDING.include?(status)
end

#skip?Boolean

Returns:

  • (Boolean)

36
37
38
# File 'lib/chibineko/testitem.rb', line 36

def skip?
  STATUS_SKIP.include?(status)
end