Class: Sqlite::DatasetTestParser

Inherits:
Object
  • Object
show all
Includes:
CommonTestParser
Defined in:
lib/parsers/dataset_test_parser.rb

Direct Known Subclasses

FinalDatasetTestParser

Constant Summary

Constants included from CommonTestParser

CommonTestParser::COMMENT

Instance Attribute Summary

Attributes included from CommonTestParser

#final, #result

Instance Method Summary collapse

Methods included from CommonTestParser

#get, #get_final, #has?, #has_final?, #initialize

Instance Method Details

#choose(_solution) ⇒ Object



24
25
26
# File 'lib/parsers/dataset_test_parser.rb', line 24

def choose(_solution)
  @solutions
end

#parse(test) ⇒ Object

test =

type: dataset,
seed: INSERT INTO ...,
expected: |
  id|field
  1|row 1
  ...

return

seed: INSERT INTO ...,
expected: -- NONE



19
20
21
22
# File 'lib/parsers/dataset_test_parser.rb', line 19

def parse(test)
  @solutions = test[:expected].to_s.split("\n").map(&:strip).join("\n")
  final_parse test, {expected: '-- NONE'}
end