datapipeline 3.0.0: transform, Parallelmodus, chained und String-Bedingungen entfernt
This commit is contained in:
@@ -14,8 +14,8 @@ class EtlCliTest < PipelineTest
|
||||
"#{dir}/#{name}"
|
||||
end
|
||||
|
||||
# like import.*.rb: own OptionParser for --from/--till, transform api
|
||||
def test_legacy_script_gets_from_till_and_limit
|
||||
# scripts with an own OptionParser for --from/--till
|
||||
def test_script_with_own_option_parser_gets_from_till_and_limit
|
||||
with_tmpdir do |dir|
|
||||
path = script(dir, 'legacy.rb', <<~RUBY)
|
||||
require 'optparse/date'
|
||||
@@ -24,8 +24,8 @@ class EtlCliTest < PipelineTest
|
||||
File.write('args.txt', "\#{opts[:from]} \#{opts[:till]}")
|
||||
DataPipeline.new do
|
||||
read container(:csv, file: 'in.csv')
|
||||
transform(processing: :prepend) { |_, _| { 'h' => 'HEAD' } }
|
||||
transform { |r, i| r.merge('i' => i) }
|
||||
header { { 'h' => 'HEAD' } }
|
||||
map { |r, ctx| r.merge('i' => ctx.index) }
|
||||
write container(:csv, file: 'out.csv', csv: { headers: false, col_sep: '|' })
|
||||
end.run
|
||||
RUBY
|
||||
|
||||
Reference in New Issue
Block a user