mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Apply syntax_tree formatting to lib/*
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'bundler/setup'
|
||||
require "bundler/setup"
|
||||
|
||||
require 'open3'
|
||||
require 'fileutils'
|
||||
require 'json'
|
||||
require 'rspec'
|
||||
require 'rails'
|
||||
require File.expand_path('../../config/environment', __FILE__)
|
||||
require "open3"
|
||||
require "fileutils"
|
||||
require "json"
|
||||
require "rspec"
|
||||
require "rails"
|
||||
require File.expand_path("../../config/environment", __FILE__)
|
||||
|
||||
require 'parallel_tests'
|
||||
require 'parallel_tests/rspec/runner'
|
||||
require "parallel_tests"
|
||||
require "parallel_tests/rspec/runner"
|
||||
|
||||
require './lib/turbo_tests/reporter'
|
||||
require './lib/turbo_tests/runner'
|
||||
require './lib/turbo_tests/json_rows_formatter'
|
||||
require "./lib/turbo_tests/reporter"
|
||||
require "./lib/turbo_tests/runner"
|
||||
require "./lib/turbo_tests/json_rows_formatter"
|
||||
|
||||
module TurboTests
|
||||
FakeException = Struct.new(:backtrace, :message, :cause)
|
||||
@@ -23,23 +23,22 @@ module TurboTests
|
||||
if obj
|
||||
obj = obj.symbolize_keys
|
||||
|
||||
klass =
|
||||
Class.new(FakeException) do
|
||||
define_singleton_method(:name) do
|
||||
obj[:class_name]
|
||||
end
|
||||
end
|
||||
klass = Class.new(FakeException) { define_singleton_method(:name) { obj[:class_name] } }
|
||||
|
||||
klass.new(
|
||||
obj[:backtrace],
|
||||
obj[:message],
|
||||
FakeException.from_obj(obj[:cause])
|
||||
)
|
||||
klass.new(obj[:backtrace], obj[:message], FakeException.from_obj(obj[:cause]))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
FakeExecutionResult = Struct.new(:example_skipped?, :pending_message, :status, :pending_fixed?, :exception, :pending_exception)
|
||||
FakeExecutionResult =
|
||||
Struct.new(
|
||||
:example_skipped?,
|
||||
:pending_message,
|
||||
:status,
|
||||
:pending_fixed?,
|
||||
:exception,
|
||||
:pending_exception,
|
||||
)
|
||||
class FakeExecutionResult
|
||||
def self.from_obj(obj)
|
||||
obj = obj.symbolize_keys
|
||||
@@ -49,26 +48,25 @@ module TurboTests
|
||||
obj[:status].to_sym,
|
||||
obj[:pending_fixed?],
|
||||
FakeException.from_obj(obj[:exception]),
|
||||
FakeException.from_obj(obj[:pending_exception])
|
||||
FakeException.from_obj(obj[:pending_exception]),
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
FakeExample = Struct.new(:execution_result, :location, :full_description, :metadata, :location_rerun_argument)
|
||||
FakeExample =
|
||||
Struct.new(:execution_result, :location, :full_description, :metadata, :location_rerun_argument)
|
||||
class FakeExample
|
||||
def self.from_obj(obj)
|
||||
obj = obj.symbolize_keys
|
||||
metadata =
|
||||
obj[:metadata].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]
|
||||
)
|
||||
}
|
||||
metadata[:shared_group_inclusion_backtrace].map! do |frame|
|
||||
frame = frame.symbolize_keys
|
||||
RSpec::Core::SharedExampleGroupInclusionStackFrame.new(
|
||||
frame[:shared_group_name],
|
||||
frame[:inclusion_location],
|
||||
)
|
||||
end
|
||||
|
||||
new(
|
||||
FakeExecutionResult.from_obj(obj[:execution_result]),
|
||||
@@ -80,9 +78,7 @@ module TurboTests
|
||||
end
|
||||
|
||||
def notification
|
||||
RSpec::Core::Notifications::ExampleNotification.for(
|
||||
self
|
||||
)
|
||||
RSpec::Core::Notifications::ExampleNotification.for(self)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user