Class: Chibineko::TestItem
- Inherits:
-
Object
- Object
- Chibineko::TestItem
- 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
-
#groups ⇒ Object
Returns the value of attribute groups.
-
#item ⇒ Object
Returns the value of attribute item.
-
#line ⇒ Object
Returns the value of attribute line.
-
#memo ⇒ Object
Returns the value of attribute memo.
-
#source ⇒ Object
Returns the value of attribute source.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #execute? ⇒ Boolean
-
#initialize(row, src, line_num = -1)) ⇒ TestItem
constructor
A new instance of TestItem.
- #location ⇒ Object
- #ng? ⇒ Boolean
- #ok? ⇒ Boolean
- #pending? ⇒ Boolean
- #skip? ⇒ Boolean
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
#groups ⇒ Object
Returns the value of attribute groups.
14 15 16 |
# File 'lib/chibineko/testitem.rb', line 14 def groups @groups end |
#item ⇒ Object
Returns the value of attribute item.
14 15 16 |
# File 'lib/chibineko/testitem.rb', line 14 def item @item end |
#line ⇒ Object
Returns the value of attribute line.
14 15 16 |
# File 'lib/chibineko/testitem.rb', line 14 def line @line end |
#memo ⇒ Object
Returns the value of attribute memo.
14 15 16 |
# File 'lib/chibineko/testitem.rb', line 14 def memo @memo end |
#source ⇒ Object
Returns the value of attribute source.
14 15 16 |
# File 'lib/chibineko/testitem.rb', line 14 def source @source end |
#status ⇒ Object
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
33 34 35 |
# File 'lib/chibineko/testitem.rb', line 33 def execute? ok? or ng? end |
#location ⇒ Object
42 43 44 |
# File 'lib/chibineko/testitem.rb', line 42 def location source + "#" + line end |
#ng? ⇒ Boolean
30 31 32 |
# File 'lib/chibineko/testitem.rb', line 30 def ng? STATUS_FAIL.include?(status) end |
#ok? ⇒ Boolean
27 28 29 |
# File 'lib/chibineko/testitem.rb', line 27 def ok? STATUS_OK.include?(status) end |
#pending? ⇒ Boolean
39 40 41 |
# File 'lib/chibineko/testitem.rb', line 39 def pending? STATUS_PENDING.include?(status) end |
#skip? ⇒ Boolean
36 37 38 |
# File 'lib/chibineko/testitem.rb', line 36 def skip? STATUS_SKIP.include?(status) end |