Class: Dragnet::Verifiers::ChangesVerifier
- Inherits:
-
RepositoryVerifier
- Object
- Verifier
- RepositoryVerifier
- Dragnet::Verifiers::ChangesVerifier
- Defined in:
- lib/dragnet/verifiers/changes_verifier.rb
Overview
Checks for changes in the repository since the creation of the MTR Record
Instance Attribute Summary collapse
-
#test_records ⇒ Object
readonly
Returns the value of attribute test_records.
Attributes inherited from RepositoryVerifier
Attributes inherited from Verifier
Instance Method Summary collapse
-
#initialize(test_record:, repository:, test_records:) ⇒ ChangesVerifier
constructor
A new instance of ChangesVerifier.
-
#verify ⇒ Dragnet::VerificationResult?
Runs the verification process.
Methods included from Helpers::RepositoryHelper
#relative_to_repo, #repo_base, #shorten_sha1
Constructor Details
#initialize(test_record:, repository:, test_records:) ⇒ ChangesVerifier
Returns a new instance of ChangesVerifier.
20 21 22 23 |
# File 'lib/dragnet/verifiers/changes_verifier.rb', line 20 def initialize(test_record:, repository:, test_records:) super(test_record: test_record, repository: repository) @test_records = test_records end |
Instance Attribute Details
#test_records ⇒ Object (readonly)
Returns the value of attribute test_records.
10 11 12 |
# File 'lib/dragnet/verifiers/changes_verifier.rb', line 10 def test_records @test_records end |
Instance Method Details
#verify ⇒ Dragnet::VerificationResult?
Runs the verification process. Checks the changes on the repository between the Commit with the SHA1 registered in the MTR and the current HEAD.
31 32 33 34 35 36 |
# File 'lib/dragnet/verifiers/changes_verifier.rb', line 31 def verify diff = repository.diff(sha1, 'HEAD') return unless diff.size.positive? find_changes(diff) end |