Carry #549: Add generator for etl#575
Conversation
|
|
||
| def indent(size, text) | ||
| text.lines.each_with_object('') { |line, obj| obj << ' ' * size + line } | ||
| end |
There was a problem hiding this comment.
ExerciseCases needs some magic indenting code in it.
There was a problem hiding this comment.
It has some magic indenting code, indent_lines.
I've started converting #workload methods over to using it when I have a reason to rewrite a #workload method.
| def test_a_single_letter | ||
| # skip | ||
| old = { | ||
| '1' => ["A"], |
There was a problem hiding this comment.
It looks like the generated test use strings rather than numbers ('1' vs 1)
| '1' => ["A"], | ||
| } | ||
| expected = { | ||
| 'a' => '1', |
There was a problem hiding this comment.
Same as above, except for the value rather than the key
| def format_hash(hash) | ||
| middle = hash.each_pair.with_object('') do |(k, v), obj| | ||
| value = v.class == Array ? v : "'#{v}'" | ||
| obj << " '#{k}' => #{value},\n " |
There was a problem hiding this comment.
When given a hash with integerized keys from here, the key is still wrapped in quotes, negating #integerize_keys.
|
Nice catch on the keys, @tommyschaefer . I'll get a chance to look at that after I get some sleep :) |
Description
Carry @ajwann's valuable work forward so we can get it in :)
See original PR for description, motivation and context.
How Has This Been Tested?
rake test
Types of changes
New feature (non-breaking change which adds functionality)Breaking change (fix or feature that would cause existing functionality to change)