Class: Dragnet::Verifiers::ChangesVerifier
- Inherits:
-
RepositoryVerifier
- Object
- Verifier
- RepositoryVerifier
- Dragnet::Verifiers::ChangesVerifier
- Includes:
- Mixins::GitErrorHandling
- 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.
23 24 25 26 |
# File 'lib/dragnet/verifiers/changes_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
#test_records ⇒ Object (readonly)
Returns the value of attribute test_records.
13 14 15 |
# File 'lib/dragnet/verifiers/changes_verifier.rb', line 13 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.
34 35 36 37 38 39 40 41 |
# File 'lib/dragnet/verifiers/changes_verifier.rb', line 34 def verify diff = repository.diff(sha1, 'HEAD') return unless diff.size.positive? find_changes(diff) rescue Git::FailedError => e result_from_git_error(e) end |