test_bench-bootstrap 7.0.1 → 7.0.2
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e69c31a9e3c8e9a9faa93deed4e46630d6d2d2fb7c5076ba4ed4a00deda92ad3
|
4
|
+
data.tar.gz: 210859751f32b656864846ebc1a28046167711054b028711aa6ba0354eb5f991
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9d2132905ca36a2231daad6c42e179bfcc944ccff00c6b67244f21d91e59b57180d6f0985cb6c9eda8d76c7e05e3a9a12826bb7d239e5202c6e0950f286e48f
|
7
|
+
data.tar.gz: 2cff56abf3645ae094fe71809ac548e67ff364dd766a2f4c2acf0149261d1b9a7c4d944b847c1ab4c757eb0723559d607029793e762a7c2683f8370298eebda8
|
@@ -548,7 +548,7 @@ module TestBenchBootstrap
|
|
548
548
|
|
549
549
|
module Defaults
|
550
550
|
def self.detail_policy
|
551
|
-
env_var_value = ENV.fetch('
|
551
|
+
env_var_value = ENV.fetch('TEST_BENCH_DETAIL', 'failure')
|
552
552
|
|
553
553
|
detail_policy = env_var_value.to_sym
|
554
554
|
|
@@ -31,10 +31,12 @@ module TestBenchBootstrap
|
|
31
31
|
|
32
32
|
module Styling
|
33
33
|
def self.example
|
34
|
+
backtrace = AbsolutePaths::Local::Backtrace.example(styling: true)
|
35
|
+
|
34
36
|
[
|
35
|
-
|
37
|
+
backtrace.first,
|
36
38
|
"\e[2;3m*omitted*\e[23;22m",
|
37
|
-
|
39
|
+
backtrace.last
|
38
40
|
]
|
39
41
|
end
|
40
42
|
end
|
@@ -66,13 +68,37 @@ module TestBenchBootstrap
|
|
66
68
|
end
|
67
69
|
|
68
70
|
def self.backtrace
|
69
|
-
|
70
|
-
backtrace_location.to_s.delete_prefix(::File.join(apex_directory, ''))
|
71
|
-
end
|
71
|
+
Backtrace.example
|
72
72
|
end
|
73
73
|
|
74
74
|
def self.apex_directory
|
75
|
-
|
75
|
+
Backtrace.apex_directory
|
76
|
+
end
|
77
|
+
|
78
|
+
module Backtrace
|
79
|
+
def self.example(styling: nil)
|
80
|
+
styling ||= false
|
81
|
+
|
82
|
+
if styling
|
83
|
+
relative_path_prefix = "\e[2m./\e[22m"
|
84
|
+
else
|
85
|
+
relative_path_prefix = "./"
|
86
|
+
end
|
87
|
+
|
88
|
+
Exception::AbsolutePaths::Example.backtrace_locations.map do |backtrace_location|
|
89
|
+
backtrace_location_text = backtrace_location.to_s
|
90
|
+
|
91
|
+
backtrace_location_text.delete_prefix!(::File.join(apex_directory, ''))
|
92
|
+
|
93
|
+
backtrace_location_text.insert(0, relative_path_prefix)
|
94
|
+
|
95
|
+
backtrace_location_text
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
def self.apex_directory
|
100
|
+
Path::ApexDirectory.tmpdir
|
101
|
+
end
|
76
102
|
end
|
77
103
|
end
|
78
104
|
end
|
@@ -39,7 +39,7 @@ module TestBenchBootstrap
|
|
39
39
|
if styling?
|
40
40
|
omitted_text = "\e[2;3m*omitted*\e[23;22m"
|
41
41
|
else
|
42
|
-
omitted_text =
|
42
|
+
omitted_text = '*omitted*'
|
43
43
|
end
|
44
44
|
|
45
45
|
backtrace = []
|
@@ -65,10 +65,8 @@ module TestBenchBootstrap
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
-
apex_directory_prefix = ::File.join(apex_directory, '')
|
69
|
-
|
70
68
|
backtrace.each do |backtrace_location_text|
|
71
|
-
backtrace_location_text
|
69
|
+
delete_apex_directory_prefix(backtrace_location_text)
|
72
70
|
end
|
73
71
|
|
74
72
|
exception.set_backtrace(backtrace)
|
@@ -84,7 +82,7 @@ module TestBenchBootstrap
|
|
84
82
|
location ||= exception.backtrace_locations.first
|
85
83
|
|
86
84
|
location = "#{location.path}:#{location.lineno}"
|
87
|
-
location
|
85
|
+
delete_apex_directory_prefix(location)
|
88
86
|
location
|
89
87
|
end
|
90
88
|
|
@@ -96,6 +94,20 @@ module TestBenchBootstrap
|
|
96
94
|
end
|
97
95
|
end
|
98
96
|
|
97
|
+
def delete_apex_directory_prefix(backtrace_location_text)
|
98
|
+
if styling?
|
99
|
+
relative_path_prefix = "\e[2m./\e[22m"
|
100
|
+
else
|
101
|
+
relative_path_prefix = './'
|
102
|
+
end
|
103
|
+
|
104
|
+
apex_directory_prefix = ::File.join(apex_directory, '')
|
105
|
+
|
106
|
+
if backtrace_location_text.delete_prefix!(apex_directory_prefix)
|
107
|
+
backtrace_location_text.insert(0, relative_path_prefix)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
99
111
|
module Defaults
|
100
112
|
def self.omit_patterns
|
101
113
|
env_omit_backtrace_pattern = ENV.fetch('TEST_BENCH_OMIT_BACKTRACE_PATTERN', '')
|