FIX: Made turbo_rspec display errors in shared groups correctly
This commit is contained in:
parent
120077ebee
commit
6b9784cf8a
|
@ -57,11 +57,23 @@ module TurboTests
|
|||
class FakeExample
|
||||
def self.from_obj(obj)
|
||||
obj = obj.symbolize_keys
|
||||
metadata =
|
||||
obj[:metadata].symbolize_keys
|
||||
|
||||
metadata[:shared_group_inclusion_backtrace]
|
||||
.map! { |frame|
|
||||
frame = frame.symbolize_keys
|
||||
RSpec::Core::SharedExampleGroupInclusionStackFrame.new(
|
||||
frame[:shared_group_name],
|
||||
frame[:inclusion_location]
|
||||
)
|
||||
}
|
||||
|
||||
new(
|
||||
FakeExecutionResult.from_obj(obj[:execution_result]),
|
||||
obj[:location],
|
||||
obj[:full_description],
|
||||
obj[:metadata].symbolize_keys,
|
||||
metadata,
|
||||
obj[:location_rerun_argument],
|
||||
)
|
||||
end
|
||||
|
|
|
@ -39,6 +39,13 @@ module TurboTests
|
|||
}
|
||||
end
|
||||
|
||||
def stack_frame_to_json(frame)
|
||||
{
|
||||
shared_group_name: frame.shared_group_name,
|
||||
inclusion_location: frame.inclusion_location
|
||||
}
|
||||
end
|
||||
|
||||
def example_to_json(example)
|
||||
{
|
||||
execution_result: execution_result_to_json(example.execution_result),
|
||||
|
@ -46,7 +53,9 @@ module TurboTests
|
|||
full_description: example.full_description,
|
||||
metadata: {
|
||||
shared_group_inclusion_backtrace:
|
||||
example.metadata[:shared_group_inclusion_backtrace]
|
||||
example
|
||||
.metadata[:shared_group_inclusion_backtrace]
|
||||
.map(&method(:stack_frame_to_json))
|
||||
},
|
||||
location_rerun_argument: example.location_rerun_argument
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue