Module: Mumukit::Templates::WithStructuredResults

Defined in:
lib/mumukit/templates/with_structured_results.rb

Instance Method Summary collapse

Instance Method Details

#post_process_file(file, result, status) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/mumukit/templates/with_structured_results.rb', line 2

def post_process_file(file, result, status)
  if [:passed, :failed].include? status
    [to_structured_result(result)]
  else
    [result, status]
  end
rescue JSON::ParserError
  [result, :errored]
end

#to_structured_result(result) ⇒ Object



12
13
14
# File 'lib/mumukit/templates/with_structured_results.rb', line 12

def to_structured_result(result)
  JSON.pretty_parse(result)
end