Class: StormForge::Dsl::TestCase::DataSource::FileFixture::FixtureSourceValidator

Inherits:
ActiveModel::Validator
  • Object
show all
Defined in:
lib/stormforge/dsl/test_case/data_source/file_fixture.rb

Instance Method Summary collapse

Instance Method Details

#validate(record) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/stormforge/dsl/test_case/data_source/file_fixture.rb', line 40

def validate(record)
  if record.source.nil?
    record.errors[:source] << "Source file must be set"
  elsif !File.exist?(record.source)
    record.errors[:source] << "Source file must exist"
  end
end