Class: Sqlite::DatasetTestParser
- Inherits:
-
Object
- Object
- Sqlite::DatasetTestParser
- Includes:
- CommonTestParser
- Defined in:
- lib/parsers/dataset_test_parser.rb
Direct Known Subclasses
Constant Summary
Constants included from CommonTestParser
Instance Attribute Summary
Attributes included from CommonTestParser
Instance Method Summary collapse
- #choose(_solution) ⇒ Object
-
#parse(test) ⇒ Object
test = { type: dataset, seed: INSERT INTO …, expected: | id|field 1|row 1 … }.
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 |