Class: Dragnet::Validators::FilesValidator
- Defined in:
- lib/dragnet/validators/files_validator.rb
Overview
Validates the files
key in the given Manual Test Record object. Validates:
- That the listed file(s) glob pattern(s) match at least one file in the
repository.
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#test_record ⇒ Object
readonly
Returns the value of attribute test_record.
Instance Method Summary collapse
-
#initialize(test_record, path) ⇒ FilesValidator
constructor
Creates a new instance of the class.
-
#validate ⇒ Object
Validates the
files
key in the given data.
Constructor Details
#initialize(test_record, path) ⇒ FilesValidator
Creates a new instance of the class.
20 21 22 23 24 |
# File 'lib/dragnet/validators/files_validator.rb', line 20 def initialize(test_record, path) @test_record = test_record @files = test_record.files @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
13 14 15 |
# File 'lib/dragnet/validators/files_validator.rb', line 13 def path @path end |
#test_record ⇒ Object (readonly)
Returns the value of attribute test_record.
13 14 15 |
# File 'lib/dragnet/validators/files_validator.rb', line 13 def test_record @test_record end |
Instance Method Details
#validate ⇒ Object
Validates the files
key in the given data. Updates the file
key in the given data
to the actual files found in the repository.
32 33 34 35 36 |
# File 'lib/dragnet/validators/files_validator.rb', line 32 def validate return unless files test_record.files = translate_paths && force_relative_paths && resolve_files end |