Class: Dragnet::TestRecord
- Inherits:
-
Object
- Object
- Dragnet::TestRecord
- Defined in:
- lib/dragnet/test_record.rb
Overview
Represents a Manual Test Record loaded from a MTR file.
Constant Summary collapse
- PASSED_RESULT =
'passed'
- REVIEWED_STATUS =
'reviewed'
- NO_FINDINGS =
'no findings'
Instance Attribute Summary collapse
-
#description ⇒ Object
:reek:Attribute (This is an entity class).
-
#files ⇒ Object
:reek:Attribute (This is an entity class).
-
#findings ⇒ Object
:reek:Attribute (This is an entity class).
-
#id ⇒ Object
:reek:Attribute (This is an entity class).
-
#name ⇒ Object
:reek:Attribute (This is an entity class).
-
#repos ⇒ Object
:reek:Attribute (This is an entity class).
-
#result ⇒ Object
:reek:Attribute (This is an entity class).
-
#review_comments ⇒ Object
:reek:Attribute (This is an entity class).
-
#review_status ⇒ Object
:reek:Attribute (This is an entity class).
-
#sha1 ⇒ Object
:reek:Attribute (This is an entity class).
-
#source_file ⇒ Object
:reek:Attribute (This is an entity class).
-
#tc_derivation_method ⇒ Object
:reek:Attribute (This is an entity class).
-
#test_method ⇒ Object
:reek:Attribute (This is an entity class).
-
#verification_result ⇒ Object
:reek:Attribute (This is an entity class).
Instance Method Summary collapse
-
#findings? ⇒ Boolean
True if the Manual Test Record has findings (problems annotated during the review), false otherwise.
-
#initialize(args) ⇒ TestRecord
constructor
Creates a new instance of the class.
-
#passed? ⇒ Boolean
True if the Manual Test passed, false otherwise.
-
#reviewed? ⇒ Boolean
True if the Manual Test Record has been reviewed, false otherwise.
-
#validate ⇒ Object
Validates the MTR's fields.
Constructor Details
#initialize(args) ⇒ TestRecord
Either :files
or :repos
should be present, not both.
Creates a new instance of the class.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/dragnet/test_record.rb', line 52 def initialize(args) @id = args[:id] @result = args[:result] @sha1 = args[:sha1] @name = args[:name] @description = args[:description] @files = args[:files] @repos = args[:repos] @review_status = args[:review_status] || args[:reviewstatus] @review_comments = args[:review_comments] || args[:reviewcomments] @findings = args[:findings] @test_method = args[:test_method] @tc_derivation_method = args[:tc_derivation_method] end |
Instance Attribute Details
#description ⇒ Object
:reek:Attribute (This is an entity class)
14 15 16 |
# File 'lib/dragnet/test_record.rb', line 14 def description @description end |
#files ⇒ Object
:reek:Attribute (This is an entity class)
14 15 16 |
# File 'lib/dragnet/test_record.rb', line 14 def files @files end |
#findings ⇒ Object
:reek:Attribute (This is an entity class)
14 15 16 |
# File 'lib/dragnet/test_record.rb', line 14 def findings @findings end |
#id ⇒ Object
:reek:Attribute (This is an entity class)
14 15 16 |
# File 'lib/dragnet/test_record.rb', line 14 def id @id end |
#name ⇒ Object
:reek:Attribute (This is an entity class)
14 15 16 |
# File 'lib/dragnet/test_record.rb', line 14 def name @name end |
#repos ⇒ Object
:reek:Attribute (This is an entity class)
14 15 16 |
# File 'lib/dragnet/test_record.rb', line 14 def repos @repos end |
#result ⇒ Object
:reek:Attribute (This is an entity class)
14 15 16 |
# File 'lib/dragnet/test_record.rb', line 14 def result @result end |
#review_comments ⇒ Object
:reek:Attribute (This is an entity class)
14 15 16 |
# File 'lib/dragnet/test_record.rb', line 14 def review_comments @review_comments end |
#review_status ⇒ Object
:reek:Attribute (This is an entity class)
14 15 16 |
# File 'lib/dragnet/test_record.rb', line 14 def review_status @review_status end |
#sha1 ⇒ Object
:reek:Attribute (This is an entity class)
14 15 16 |
# File 'lib/dragnet/test_record.rb', line 14 def sha1 @sha1 end |
#source_file ⇒ Object
:reek:Attribute (This is an entity class)
14 15 16 |
# File 'lib/dragnet/test_record.rb', line 14 def source_file @source_file end |
#tc_derivation_method ⇒ Object
:reek:Attribute (This is an entity class)
14 15 16 |
# File 'lib/dragnet/test_record.rb', line 14 def tc_derivation_method @tc_derivation_method end |
#test_method ⇒ Object
:reek:Attribute (This is an entity class)
14 15 16 |
# File 'lib/dragnet/test_record.rb', line 14 def test_method @test_method end |
#verification_result ⇒ Object
:reek:Attribute (This is an entity class)
14 15 16 |
# File 'lib/dragnet/test_record.rb', line 14 def verification_result @verification_result end |
Instance Method Details
#findings? ⇒ Boolean
Returns True if the Manual Test Record has findings (problems annotated during the review), false otherwise.
87 88 89 |
# File 'lib/dragnet/test_record.rb', line 87 def findings? !(findings.nil? || findings.strip.empty? || findings.downcase == NO_FINDINGS) end |
#passed? ⇒ Boolean
Returns True if the Manual Test passed, false otherwise.
75 76 77 |
# File 'lib/dragnet/test_record.rb', line 75 def passed? result == PASSED_RESULT end |
#reviewed? ⇒ Boolean
Returns True if the Manual Test Record has been reviewed, false otherwise.
81 82 83 |
# File 'lib/dragnet/test_record.rb', line 81 def reviewed? review_status == REVIEWED_STATUS end |
#validate ⇒ Object
Validates the MTR's fields
70 71 72 |
# File 'lib/dragnet/test_record.rb', line 70 def validate Dragnet::Validators::Entities::TestRecordValidator.new(self).validate end |