Class: Dragnet::Verifiers::TestRecordVerifier
- Defined in:
- lib/dragnet/verifiers/test_record_verifier.rb
Overview
Performs the verification process over a single TestRecord object.
Instance Attribute Summary collapse
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#test_records ⇒ Object
readonly
Returns the value of attribute test_records.
Attributes inherited from Verifier
Instance Method Summary collapse
-
#initialize(test_record:, repository:, test_records:) ⇒ TestRecordVerifier
constructor
A new instance of TestRecordVerifier.
-
#verify ⇒ Dragnet::VerificationResult
Performs the verification and attaches the corresponding
VerificationResult
object to theTestRecord
object.
Methods included from Helpers::RepositoryHelper
#relative_to_repo, #repo_base, #shorten_sha1
Constructor Details
#initialize(test_record:, repository:, test_records:) ⇒ TestRecordVerifier
Returns a new instance of TestRecordVerifier.
23 24 25 26 27 |
# File 'lib/dragnet/verifiers/test_record_verifier.rb', line 23 def initialize(test_record:, repository:, test_records:) super(test_record: test_record) @repository = repository @test_records = test_records end |
Instance Attribute Details
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
13 14 15 |
# File 'lib/dragnet/verifiers/test_record_verifier.rb', line 13 def repository @repository end |
#test_records ⇒ Object (readonly)
Returns the value of attribute test_records.
13 14 15 |
# File 'lib/dragnet/verifiers/test_record_verifier.rb', line 13 def test_records @test_records end |
Instance Method Details
#verify ⇒ Dragnet::VerificationResult
Performs the verification and attaches the corresponding VerificationResult
object to the TestRecord
object.
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/dragnet/verifiers/test_record_verifier.rb', line 33 def verify verification_result = verify_result verification_result ||= if test_record.files verify_files elsif test_record.repos verify_repos else verify_changes end verification_result || Dragnet::VerificationResult.new(status: :passed) end |