2015-09-03 18:36:46 +00:00
|
|
|
# encoding: utf-8
|
2015-10-06 16:55:44 +00:00
|
|
|
# author: Dominik Richter
|
|
|
|
# author: Christoph Hartmann
|
|
|
|
|
2015-06-07 15:09:02 +00:00
|
|
|
require 'rspec/core'
|
|
|
|
|
|
|
|
# Extend the basic RSpec JSON Formatter
|
|
|
|
# to give us an ID in its output
|
|
|
|
# TODO: remove once RSpec has IDs in stable (probably v3.3/v4.0)
|
|
|
|
module RSpec::Core::Formatters
|
|
|
|
class JsonFormatter
|
|
|
|
private
|
2015-09-05 14:07:54 +00:00
|
|
|
|
2015-06-07 15:09:02 +00:00
|
|
|
def format_example(example)
|
|
|
|
{
|
2015-09-05 14:07:54 +00:00
|
|
|
description: example.description,
|
|
|
|
full_description: example.full_description,
|
|
|
|
status: example.execution_result.status.to_s,
|
|
|
|
file_path: example.metadata['file_path'],
|
|
|
|
line_number: example.metadata['line_number'],
|
|
|
|
run_time: example.execution_result.run_time,
|
|
|
|
pending_message: example.execution_result.pending_message,
|
2015-09-09 14:29:20 +00:00
|
|
|
id: example.metadata[:id],
|
2015-06-07 15:09:02 +00:00
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
2015-08-12 19:03:41 +00:00
|
|
|
end
|