cornucopia 0.1.45 → 0.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a8e94bb41c7949e5e0dbbe66d6dd7b7f96fc435
|
4
|
+
data.tar.gz: d1320a0ddc572ee057fca960c0c0fe4f9610052f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cad4332db00edc14962d0ac7ff22dd86f22f4a33e9f776536110606f14e903e1e2cba4a34e422f36538971e3e0bea0ff421c664af67d7a6d202f45db1a2af4e0
|
7
|
+
data.tar.gz: c978849262aac948e4743cc2556cd41b1bd62c3434aad3eeb85fb3f0ec590230c77d5fe7b0be28bd99cecb15edf65e2a0cb81e70424de8d7fc1afbe980d40b7d
|
@@ -4,6 +4,7 @@ require "singleton"
|
|
4
4
|
require ::File.expand_path('configured_report', File.dirname(__FILE__))
|
5
5
|
require ::File.expand_path('generic_settings', File.dirname(__FILE__))
|
6
6
|
require ::File.expand_path('report_formatters', File.dirname(__FILE__))
|
7
|
+
require ::File.expand_path('multiple_exception_formatter', File.dirname(__FILE__))
|
7
8
|
|
8
9
|
module Cornucopia
|
9
10
|
module Util
|
@@ -67,7 +68,9 @@ module Cornucopia
|
|
67
68
|
:capybara_page_diagnostics,
|
68
69
|
{
|
69
70
|
report_element: :example__exception__all_exceptions,
|
70
|
-
report_options: { ignore_missing:
|
71
|
+
report_options: { ignore_missing: true,
|
72
|
+
format_object: Cornucopia::Util::MultipleExceptionFormatter,
|
73
|
+
format_function: :format_backtrace }
|
71
74
|
}
|
72
75
|
],
|
73
76
|
expand_fields: [
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cornucopia
|
4
|
+
module Util
|
5
|
+
class MultipleExceptionFormatter
|
6
|
+
def self.format_backtrace(value)
|
7
|
+
return value.to_s unless value.is_a?(Array) && value.all? { |val| val.is_a?(Exception) }
|
8
|
+
value_text = value.each_with_object([]) do |error, array|
|
9
|
+
array << "Exception \##{array.length + 1}\n#{error.backtrace.join("\n")}"
|
10
|
+
end.join("\n\n")
|
11
|
+
|
12
|
+
Cornucopia::Util::ReportBuilder.pretty_format(value_text)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/cornucopia/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cornucopia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.46
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RealNobody
|
@@ -250,6 +250,7 @@ files:
|
|
250
250
|
- lib/cornucopia/util/file_asset.rb
|
251
251
|
- lib/cornucopia/util/generic_settings.rb
|
252
252
|
- lib/cornucopia/util/log_capture.rb
|
253
|
+
- lib/cornucopia/util/multiple_exception_formatter.rb
|
253
254
|
- lib/cornucopia/util/pretty_formatter.rb
|
254
255
|
- lib/cornucopia/util/report_builder.rb
|
255
256
|
- lib/cornucopia/util/report_formatters.rb
|