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
-
#initialize(test) ⇒ DatasetTestParser
constructor
A new instance of DatasetTestParser.
-
#parse(test) ⇒ Object
test = { type: dataset, seed: INSERT INTO …, expected: | id|field 1|row 1 … }.
Constructor Details
#initialize(test) ⇒ DatasetTestParser
Returns a new instance of DatasetTestParser.
6 7 8 9 |
# File 'lib/parsers/dataset_test_parser.rb', line 6 def initialize(test) @test = test @result = parse test end |
Instance Method Details
#choose(_solution) ⇒ Object
29 30 31 |
# File 'lib/parsers/dataset_test_parser.rb', line 29 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
24 25 26 27 |
# File 'lib/parsers/dataset_test_parser.rb', line 24 def parse(test) @solutions = test[:expected].to_s.split("\n").map(&:strip).join("\n") final_parse test, {expected: '-- NONE'} end |