Class: Kiba::Extend::JobTest::CsvJob::Equal

Inherits:
Object
  • Object
show all
Includes:
Testable
Defined in:
lib/kiba/extend/job_test/csv_job/equal.rb

Overview

Selects rows matching select field/value

Constant Summary

Constants included from JobTestable

JobTestable::ALLOWED_CONFIG_KEY_PATTERN

Instance Method Summary collapse

Methods included from Testable

#get_job_data

Methods included from JobTestable

#job_data, #result

Constructor Details

#initialize(config) ⇒ Equal

Returns a new instance of Equal.

Parameters:

  • config (Hash)

    Other keys will be part of the config Hash, but are not required for this class’ function

Options Hash (config):

  • :path (String)

    Path to job output

  • :select_field (Symbol)

    Field whose value will be used to select row to test

  • :select_value (String)

    Value that will be matched (using ==) in :select_field to select test row

  • :test_field (Symbol)

    Field in first row of test rows whose value will be tested

  • :expected (String)

    Value expected in :test_field of first row of test rows



23
24
25
# File 'lib/kiba/extend/job_test/csv_job/equal.rb', line 23

def initialize(config, job_data = nil)
  initialization_logic(config)
end

Instance Method Details

#descString

Returns:

  • (String)


28
29
30
31
# File 'lib/kiba/extend/job_test/csv_job/equal.rb', line 28

def desc
  "When #{select_field} is #{select_value}, #{test_field} == "\
    "#{expected}"
end