diff --git a/test.rb b/test.rb index caa2b34..c2f80df 100755 --- a/test.rb +++ b/test.rb @@ -99,16 +99,20 @@ cmd :REGISTER_CATEGORY, :link ################### cmd :REGISTER_FORMAT, { name: :html, - stdin: { notes: nil }, args: ['test/render.rb', { template: nil }, - { format: nil }] } + { format: nil }], + stdin: ['{"notes":', + { notes: nil }, + '}'] } cmd :REGISTER_FORMAT, { name: :json, - stdin: { notes: nil }, args: ['test/render.rb', { template: nil }, - { format: nil }] } + { format: nil }], + stdin: ['{"notes":', + { notes: nil }, + '}'] } ################ # REGISTER_REF # diff --git a/test/render.rb b/test/render.rb index 3f5dfcb..dd03544 100755 --- a/test/render.rb +++ b/test/render.rb @@ -12,6 +12,7 @@ def template(filename) end.freeze end -puts template("#{ARGV[0]}.#{ARGV[1]}.erb").result_with_hash( - notes: JSON.parse($stdin.read), -).strip +name = "#{ARGV[0]}.#{ARGV[1]}.erb".freeze +vars = JSON.parse($stdin.read).freeze + +puts template(name).result_with_hash(vars).strip