Class: Dragnet::Validators::ReposValidator

Inherits:
Validator
  • Object
show all
Defined in:
lib/dragnet/validators/repos_validator.rb

Overview

Validates the Repo objects attached to the given TestRecord

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(test_record, path) ⇒ ReposValidator

Returns a new instance of ReposValidator.

Parameters:

  • test_record (Dragnet::TestRecord)

    The Test Record to validate.

  • path (Pathname)

    The path where the repositories are supposed to be located.



15
16
17
18
19
# File 'lib/dragnet/validators/repos_validator.rb', line 15

def initialize(test_record, path)
  @test_record = test_record
  @path = path
  @repos = test_record.repos
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



10
11
12
# File 'lib/dragnet/validators/repos_validator.rb', line 10

def path
  @path
end

#reposObject (readonly)

Returns the value of attribute repos.



10
11
12
# File 'lib/dragnet/validators/repos_validator.rb', line 10

def repos
  @repos
end

#test_recordObject (readonly)

Returns the value of attribute test_record.



10
11
12
# File 'lib/dragnet/validators/repos_validator.rb', line 10

def test_record
  @test_record
end

Instance Method Details

#validateObject

Validates the Repo objects inside the given TestCase



22
23
24
25
26
# File 'lib/dragnet/validators/repos_validator.rb', line 22

def validate
  return unless repos

  validate_paths
end