test_bench-bootstrap 3.0.0.0.pre.1 → 3.0.0
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 +4 -4
- data/lib/test_bench/bootstrap.rb +373 -0
- metadata +16 -353
- data/executables/bench-bootstrap +0 -7
- data/lib/test_bench_bootstrap/controls.rb +0 -1
- data/lib/test_bench_bootstrap/test_bench_bootstrap.rb +0 -7
- data/lib/test_bench_bootstrap.rb +0 -4
- data/upstream-lib/test_bench_bootstrap/import_constants/controls/namespace.rb +0 -84
- data/upstream-lib/test_bench_bootstrap/import_constants/controls.rb +0 -1
- data/upstream-lib/test_bench_bootstrap/import_constants/import_constants.rb +0 -46
- data/upstream-lib/test_bench_bootstrap/import_constants/macro.rb +0 -10
- data/upstream-lib/test_bench_bootstrap/import_constants.rb +0 -2
- data/upstream-lib/test_bench_bootstrap/test_bench/controls/telemetry_sink.rb +0 -7
- data/upstream-lib/test_bench_bootstrap/test_bench/controls.rb +0 -3
- data/upstream-lib/test_bench_bootstrap/test_bench/executable/controls/path.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/executable/controls/random.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/executable/controls/run.rb +0 -12
- data/upstream-lib/test_bench_bootstrap/test_bench/executable/controls/standard_input.rb +0 -31
- data/upstream-lib/test_bench_bootstrap/test_bench/executable/controls.rb +0 -8
- data/upstream-lib/test_bench_bootstrap/test_bench/executable/defaults.rb +0 -15
- data/upstream-lib/test_bench_bootstrap/test_bench/executable/executable.rb +0 -61
- data/upstream-lib/test_bench_bootstrap/test_bench/executable/parse_arguments.rb +0 -271
- data/upstream-lib/test_bench_bootstrap/test_bench/executable.rb +0 -7
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/build.rb +0 -41
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/comment_style.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/exception.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/fixture.rb +0 -69
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/message.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/output.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/path.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/session.rb +0 -21
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/status.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/text.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls/title.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/controls.rb +0 -14
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/evaluate.rb +0 -37
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture/fixture.rb +0 -213
- data/upstream-lib/test_bench_bootstrap/test_bench/fixture.rb +0 -7
- data/upstream-lib/test_bench_bootstrap/test_bench/output/comment_style.rb +0 -63
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/comment_style.rb +0 -23
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/event.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/aborted.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/commented.rb +0 -23
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/context_finished.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/context_started.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/detailed.rb +0 -23
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/failed.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/file_executed.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/file_not_found.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/file_queued.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/skipped.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/test_finished.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/events/test_started.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/random.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/session.rb +0 -19
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/status.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/style.rb +0 -41
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls/text.rb +0 -31
- data/upstream-lib/test_bench_bootstrap/test_bench/output/controls.rb +0 -26
- data/upstream-lib/test_bench_bootstrap/test_bench/output/detail_policy.rb +0 -46
- data/upstream-lib/test_bench_bootstrap/test_bench/output/device/null.rb +0 -21
- data/upstream-lib/test_bench_bootstrap/test_bench/output/device/substitute.rb +0 -46
- data/upstream-lib/test_bench_bootstrap/test_bench/output/device.rb +0 -75
- data/upstream-lib/test_bench_bootstrap/test_bench/output/get.rb +0 -32
- data/upstream-lib/test_bench_bootstrap/test_bench/output/level.rb +0 -53
- data/upstream-lib/test_bench_bootstrap/test_bench/output/output.rb +0 -572
- data/upstream-lib/test_bench_bootstrap/test_bench/output/writer/style.rb +0 -54
- data/upstream-lib/test_bench_bootstrap/test_bench/output/writer/substitute.rb +0 -27
- data/upstream-lib/test_bench_bootstrap/test_bench/output/writer.rb +0 -119
- data/upstream-lib/test_bench_bootstrap/test_bench/output.rb +0 -20
- data/upstream-lib/test_bench_bootstrap/test_bench/random/controls/seed.rb +0 -25
- data/upstream-lib/test_bench_bootstrap/test_bench/random/controls/sequence.rb +0 -70
- data/upstream-lib/test_bench_bootstrap/test_bench/random/controls.rb +0 -2
- data/upstream-lib/test_bench_bootstrap/test_bench/random/defaults.rb +0 -13
- data/upstream-lib/test_bench_bootstrap/test_bench/random/generator/substitute.rb +0 -23
- data/upstream-lib/test_bench_bootstrap/test_bench/random/generator.rb +0 -64
- data/upstream-lib/test_bench_bootstrap/test_bench/random/iterator.rb +0 -54
- data/upstream-lib/test_bench_bootstrap/test_bench/random/random.rb +0 -27
- data/upstream-lib/test_bench_bootstrap/test_bench/random.rb +0 -8
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/events.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/message.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/path.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/random.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/session.rb +0 -16
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/status.rb +0 -44
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/summary/file/info.rb +0 -108
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/summary/file/totals.rb +0 -38
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/summary/file.rb +0 -44
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/summary/run.rb +0 -53
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/summary.rb +0 -45
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/telemetry.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls/time.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/run/controls.rb +0 -20
- data/upstream-lib/test_bench_bootstrap/test_bench/run/run.rb +0 -146
- data/upstream-lib/test_bench_bootstrap/test_bench/run/select_files/substitute.rb +0 -45
- data/upstream-lib/test_bench_bootstrap/test_bench/run/select_files.rb +0 -70
- data/upstream-lib/test_bench_bootstrap/test_bench/run/substitute.rb +0 -42
- data/upstream-lib/test_bench_bootstrap/test_bench/run/summary/substitute.rb +0 -19
- data/upstream-lib/test_bench_bootstrap/test_bench/run/summary.rb +0 -477
- data/upstream-lib/test_bench_bootstrap/test_bench/run.rb +0 -10
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/backtrace/location.rb +0 -48
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/backtrace.rb +0 -83
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/comment_disposition.rb +0 -17
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/event.rb +0 -35
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/aborted.rb +0 -51
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/commented.rb +0 -62
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/context_finished.rb +0 -112
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/context_started.rb +0 -51
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/detailed.rb +0 -62
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/failed.rb +0 -41
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/file_executed.rb +0 -101
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/file_not_found.rb +0 -41
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/file_queued.rb +0 -41
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/skipped.rb +0 -51
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/test_finished.rb +0 -92
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events/test_started.rb +0 -51
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/events.rb +0 -35
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/exception/message.rb +0 -23
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/exception/raise.rb +0 -52
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/exception.rb +0 -81
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/message.rb +0 -43
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/metadata.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/path/apex_directory.rb +0 -76
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/path/file/create.rb +0 -113
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/path/file.rb +0 -42
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/path.rb +0 -87
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/random.rb +0 -9
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/result.rb +0 -17
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/sequence.rb +0 -13
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/status.rb +0 -92
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/telemetry.rb +0 -15
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/telemetry_sink.rb +0 -37
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/text.rb +0 -33
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls/title.rb +0 -41
- data/upstream-lib/test_bench_bootstrap/test_bench/session/controls.rb +0 -43
- data/upstream-lib/test_bench_bootstrap/test_bench/session/defaults.rb +0 -17
- data/upstream-lib/test_bench_bootstrap/test_bench/session/events.rb +0 -24
- data/upstream-lib/test_bench_bootstrap/test_bench/session/exception/format_backtrace/substitute.rb +0 -34
- data/upstream-lib/test_bench_bootstrap/test_bench/session/exception/format_backtrace.rb +0 -114
- data/upstream-lib/test_bench_bootstrap/test_bench/session/isolate/substitute.rb +0 -45
- data/upstream-lib/test_bench_bootstrap/test_bench/session/isolate.rb +0 -159
- data/upstream-lib/test_bench_bootstrap/test_bench/session/result.rb +0 -44
- data/upstream-lib/test_bench_bootstrap/test_bench/session/session.rb +0 -236
- data/upstream-lib/test_bench_bootstrap/test_bench/session/status.rb +0 -60
- data/upstream-lib/test_bench_bootstrap/test_bench/session/substitute/sink.rb +0 -99
- data/upstream-lib/test_bench_bootstrap/test_bench/session/substitute.rb +0 -154
- data/upstream-lib/test_bench_bootstrap/test_bench/session/trace.rb +0 -53
- data/upstream-lib/test_bench_bootstrap/test_bench/session.rb +0 -22
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls/event/metadata.rb +0 -72
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls/event.rb +0 -156
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls/event_data.rb +0 -113
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls/handler.rb +0 -83
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls/path/file.rb +0 -39
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls/process_id.rb +0 -25
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls/random.rb +0 -11
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls/sink.rb +0 -35
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls/time.rb +0 -104
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/controls.rb +0 -16
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/event.rb +0 -130
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/event_data/serialization.rb +0 -85
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/event_data.rb +0 -15
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/sink/file.rb +0 -39
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/sink/handler/event_registry.rb +0 -44
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/sink/handler.rb +0 -128
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/sink.rb +0 -13
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/substitute/sink.rb +0 -71
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/substitute.rb +0 -43
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry/telemetry.rb +0 -92
- data/upstream-lib/test_bench_bootstrap/test_bench/telemetry.rb +0 -18
- data/upstream-lib/test_bench_bootstrap/test_bench/test_bench.rb +0 -72
- data/upstream-lib/test_bench_bootstrap/test_bench.rb +0 -4
@@ -1,213 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
module Fixture
|
4
|
-
def test_session
|
5
|
-
@test_session ||= Session::Substitute.build
|
6
|
-
end
|
7
|
-
attr_writer :test_session
|
8
|
-
|
9
|
-
def self.assure_boolean(value, message_subject)
|
10
|
-
if not value == true || value == false
|
11
|
-
raise Session::Failure, "#{message_subject} given non-boolean value: #{value.inspect}"
|
12
|
-
end
|
13
|
-
|
14
|
-
return "#{message_subject} failed"
|
15
|
-
end
|
16
|
-
|
17
|
-
def assert(value)
|
18
|
-
failure_message = Fixture.assure_boolean(value, "Assertion")
|
19
|
-
|
20
|
-
test_session.assert(value, failure_message)
|
21
|
-
end
|
22
|
-
|
23
|
-
def refute(value)
|
24
|
-
failure_message = Fixture.assure_boolean(value, "Refutation")
|
25
|
-
|
26
|
-
negated_value = !value
|
27
|
-
|
28
|
-
test_session.assert(negated_value, failure_message)
|
29
|
-
end
|
30
|
-
|
31
|
-
def assert_raises(exception_class=nil, message=nil, strict: nil, &block)
|
32
|
-
if exception_class.nil?
|
33
|
-
strict = false
|
34
|
-
exception_class = StandardError
|
35
|
-
end
|
36
|
-
|
37
|
-
if strict.nil?
|
38
|
-
strict = true
|
39
|
-
end
|
40
|
-
|
41
|
-
test_session.detail "Expected exception: #{exception_class}#{' (strict)' if strict}"
|
42
|
-
if not message.nil?
|
43
|
-
test_session.detail "Expected message: #{message.inspect}"
|
44
|
-
end
|
45
|
-
|
46
|
-
block.()
|
47
|
-
|
48
|
-
rescue exception_class => exception
|
49
|
-
test_session.detail "Raised exception: #{exception.inspect}#{" (subclass of #{exception_class})" if exception.class < exception_class}"
|
50
|
-
|
51
|
-
if strict && !exception.instance_of?(exception_class)
|
52
|
-
raise
|
53
|
-
end
|
54
|
-
|
55
|
-
if not message.nil?
|
56
|
-
assert(exception.message == message)
|
57
|
-
else
|
58
|
-
assert(true)
|
59
|
-
end
|
60
|
-
|
61
|
-
else
|
62
|
-
test_session.detail "(No exception was raised)"
|
63
|
-
assert(false)
|
64
|
-
end
|
65
|
-
|
66
|
-
def refute_raises(exception_class=nil, strict: nil, &block)
|
67
|
-
if exception_class.nil?
|
68
|
-
strict = false
|
69
|
-
exception_class = StandardError
|
70
|
-
end
|
71
|
-
|
72
|
-
if strict.nil?
|
73
|
-
strict = true
|
74
|
-
end
|
75
|
-
|
76
|
-
test_session.detail "Prohibited exception: #{exception_class}#{' (strict)' if strict}"
|
77
|
-
|
78
|
-
block.()
|
79
|
-
|
80
|
-
rescue exception_class => exception
|
81
|
-
|
82
|
-
test_session.detail "Raised exception: #{exception.inspect}#{" (subclass of #{exception_class})" if exception.class < exception_class}"
|
83
|
-
|
84
|
-
if strict && !exception.instance_of?(exception_class)
|
85
|
-
raise
|
86
|
-
end
|
87
|
-
|
88
|
-
assert(false)
|
89
|
-
|
90
|
-
else
|
91
|
-
test_session.detail "(No exception was raised)"
|
92
|
-
assert(true)
|
93
|
-
end
|
94
|
-
|
95
|
-
def self.comment_text_and_disposition(text_or_fixture, style: nil, disposition: nil)
|
96
|
-
case text_or_fixture
|
97
|
-
in String => text
|
98
|
-
style ||= Output::CommentStyle.detect
|
99
|
-
|
100
|
-
in Fixture => fixture
|
101
|
-
style ||= Output::CommentStyle.block
|
102
|
-
|
103
|
-
test_session = fixture.test_session
|
104
|
-
|
105
|
-
text = Output::Get.(test_session)
|
106
|
-
|
107
|
-
in Object => object
|
108
|
-
style ||= Output::CommentStyle.detect
|
109
|
-
|
110
|
-
text = String.try_convert(object)
|
111
|
-
if text.nil?
|
112
|
-
raise TypeError, "no implicit conversion of #{object.class} into String"
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
disposition ||= Output::CommentStyle.get_disposition(style)
|
117
|
-
|
118
|
-
return text, disposition
|
119
|
-
end
|
120
|
-
|
121
|
-
def comment(heading_text=nil, text_or_fixture, style: nil, disposition: nil)
|
122
|
-
if not heading_text.nil?
|
123
|
-
heading_style = Output::CommentStyle.heading
|
124
|
-
|
125
|
-
comment(heading_text, style: heading_style)
|
126
|
-
end
|
127
|
-
|
128
|
-
text, disposition = Fixture.comment_text_and_disposition(text_or_fixture, style:, disposition:)
|
129
|
-
|
130
|
-
test_session.comment(text, disposition)
|
131
|
-
end
|
132
|
-
|
133
|
-
def detail(heading_text=nil, text_or_fixture, style: nil, disposition: nil)
|
134
|
-
if not heading_text.nil?
|
135
|
-
heading_style = Output::CommentStyle.heading
|
136
|
-
|
137
|
-
detail(heading_text, style: heading_style)
|
138
|
-
end
|
139
|
-
|
140
|
-
text, disposition = Fixture.comment_text_and_disposition(text_or_fixture, style:, disposition:)
|
141
|
-
|
142
|
-
test_session.detail(text, disposition)
|
143
|
-
end
|
144
|
-
|
145
|
-
def self.title(title)
|
146
|
-
if title.nil? || title.instance_of?(String)
|
147
|
-
return title
|
148
|
-
end
|
149
|
-
|
150
|
-
title_string = String.try_convert(title)
|
151
|
-
if title_string.nil?
|
152
|
-
raise TypeError, "can't convert #{title.class} into #{String}"
|
153
|
-
end
|
154
|
-
|
155
|
-
title_string
|
156
|
-
end
|
157
|
-
|
158
|
-
def test(title=nil, &block)
|
159
|
-
title = Fixture.title(title)
|
160
|
-
|
161
|
-
if block.nil?
|
162
|
-
skip_message = title
|
163
|
-
test_session.skip(skip_message)
|
164
|
-
return nil
|
165
|
-
end
|
166
|
-
|
167
|
-
result = test_session.test(title, &block)
|
168
|
-
|
169
|
-
Session::Result.resolve(result, strict: true)
|
170
|
-
end
|
171
|
-
|
172
|
-
def test!(...)
|
173
|
-
if not test(...)
|
174
|
-
throw(Session::ExecutionBreak)
|
175
|
-
end
|
176
|
-
end
|
177
|
-
|
178
|
-
def context(title=nil, &block)
|
179
|
-
title = Fixture.title(title)
|
180
|
-
|
181
|
-
if block.nil?
|
182
|
-
skip_message = title
|
183
|
-
test_session.skip(skip_message)
|
184
|
-
return nil
|
185
|
-
end
|
186
|
-
|
187
|
-
result = test_session.context(title, &block)
|
188
|
-
|
189
|
-
Session::Result.resolve(result, strict: true)
|
190
|
-
end
|
191
|
-
|
192
|
-
def context!(...)
|
193
|
-
if not context(...)
|
194
|
-
throw(Session::ExecutionBreak)
|
195
|
-
end
|
196
|
-
end
|
197
|
-
|
198
|
-
def execute(file_path)
|
199
|
-
test_session.execute(file_path)
|
200
|
-
end
|
201
|
-
|
202
|
-
def fixture(fixture_class, *, test_session: nil, **, &)
|
203
|
-
test_session ||= self.test_session
|
204
|
-
|
205
|
-
fixture = Build.(fixture_class, *, test_session:, **, &)
|
206
|
-
|
207
|
-
fixture.()
|
208
|
-
|
209
|
-
fixture
|
210
|
-
end
|
211
|
-
end
|
212
|
-
end
|
213
|
-
end
|
@@ -1,63 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Output
|
4
|
-
module CommentStyle
|
5
|
-
Error = Class.new(RuntimeError)
|
6
|
-
|
7
|
-
def self.fetch(comment_disposition)
|
8
|
-
comment_style = get(comment_disposition)
|
9
|
-
|
10
|
-
comment_style ||= normal
|
11
|
-
|
12
|
-
comment_style
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.get(comment_disposition)
|
16
|
-
comment_style, _ = comment_styles.rassoc(comment_disposition)
|
17
|
-
comment_style
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.get_disposition(comment_style)
|
21
|
-
comment_styles.fetch(comment_style) do
|
22
|
-
raise Error, "Incorrect comment style: #{comment_style.inspect}"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def self.comment_styles
|
27
|
-
{
|
28
|
-
:detect => 'detect',
|
29
|
-
:normal => 'normal',
|
30
|
-
:heading => 'heading',
|
31
|
-
:block => 'block',
|
32
|
-
:line_number => 'line_number',
|
33
|
-
:raw => 'raw'
|
34
|
-
}
|
35
|
-
end
|
36
|
-
|
37
|
-
def self.detect
|
38
|
-
:detect
|
39
|
-
end
|
40
|
-
|
41
|
-
def self.normal
|
42
|
-
:normal
|
43
|
-
end
|
44
|
-
|
45
|
-
def self.heading
|
46
|
-
:heading
|
47
|
-
end
|
48
|
-
|
49
|
-
def self.block
|
50
|
-
:block
|
51
|
-
end
|
52
|
-
|
53
|
-
def self.line_number
|
54
|
-
:line_number
|
55
|
-
end
|
56
|
-
|
57
|
-
def self.raw
|
58
|
-
:raw
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Output
|
4
|
-
module Controls
|
5
|
-
module CommentStyle
|
6
|
-
def self.example
|
7
|
-
:normal
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.disposition
|
11
|
-
'normal'
|
12
|
-
end
|
13
|
-
|
14
|
-
module Disposition
|
15
|
-
def self.example
|
16
|
-
Session::CommentDisposition.example
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Output
|
4
|
-
module Controls
|
5
|
-
module Events
|
6
|
-
module Commented
|
7
|
-
def self.example(text: nil, style: nil)
|
8
|
-
style ||= self.style
|
9
|
-
|
10
|
-
disposition = Output::CommentStyle.get_disposition(style)
|
11
|
-
|
12
|
-
Session::Events::Commented.example(text:, disposition:)
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.style
|
16
|
-
CommentStyle.example
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Output
|
4
|
-
module Controls
|
5
|
-
module Events
|
6
|
-
module Detailed
|
7
|
-
def self.example(text: nil, style: nil)
|
8
|
-
style ||= self.style
|
9
|
-
|
10
|
-
disposition = Output::CommentStyle.get_disposition(style)
|
11
|
-
|
12
|
-
Session::Events::Detailed.example(text:, disposition:)
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.style
|
16
|
-
CommentStyle.example
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Output
|
4
|
-
module Controls
|
5
|
-
module Session
|
6
|
-
Events = TestBench::Session::Controls::Events
|
7
|
-
|
8
|
-
Event = TestBench::Session::Controls::Event
|
9
|
-
|
10
|
-
Status = TestBench::Session::Controls::Status
|
11
|
-
|
12
|
-
Random = TestBench::Session::Controls::Random
|
13
|
-
|
14
|
-
CommentDisposition = TestBench::Session::Controls::CommentDisposition
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Output
|
4
|
-
module Controls
|
5
|
-
module Style
|
6
|
-
def self.example
|
7
|
-
:bold
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.code
|
11
|
-
'1'
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.other_example
|
15
|
-
Other.example
|
16
|
-
end
|
17
|
-
|
18
|
-
module Other
|
19
|
-
def self.example
|
20
|
-
:italic
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.code
|
24
|
-
'3'
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
module Code
|
29
|
-
def self.example
|
30
|
-
Style.code
|
31
|
-
end
|
32
|
-
|
33
|
-
def self.other_example
|
34
|
-
Other.code
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Output
|
4
|
-
module Controls
|
5
|
-
module Text
|
6
|
-
def self.example
|
7
|
-
"Some text"
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.other_example
|
11
|
-
"Some other text"
|
12
|
-
end
|
13
|
-
|
14
|
-
module NewlineTerminated
|
15
|
-
def self.example(lines: nil)
|
16
|
-
lines ||= 1
|
17
|
-
|
18
|
-
line_count = lines
|
19
|
-
|
20
|
-
lines = (1..line_count).map do |line_number|
|
21
|
-
"Line #{line_number}\n"
|
22
|
-
end
|
23
|
-
|
24
|
-
lines.join
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'test_bench_bootstrap/test_bench/session/controls'
|
2
|
-
|
3
|
-
require 'test_bench_bootstrap/test_bench/output/controls/session'
|
4
|
-
|
5
|
-
require 'test_bench_bootstrap/test_bench/output/controls/random'
|
6
|
-
require 'test_bench_bootstrap/test_bench/output/controls/status'
|
7
|
-
require 'test_bench_bootstrap/test_bench/output/controls/text'
|
8
|
-
|
9
|
-
require 'test_bench_bootstrap/test_bench/output/controls/style'
|
10
|
-
|
11
|
-
require 'test_bench_bootstrap/test_bench/output/controls/comment_style'
|
12
|
-
|
13
|
-
require 'test_bench_bootstrap/test_bench/output/controls/events/failed'
|
14
|
-
require 'test_bench_bootstrap/test_bench/output/controls/events/aborted'
|
15
|
-
require 'test_bench_bootstrap/test_bench/output/controls/events/skipped'
|
16
|
-
require 'test_bench_bootstrap/test_bench/output/controls/events/commented'
|
17
|
-
require 'test_bench_bootstrap/test_bench/output/controls/events/detailed'
|
18
|
-
require 'test_bench_bootstrap/test_bench/output/controls/events/test_started'
|
19
|
-
require 'test_bench_bootstrap/test_bench/output/controls/events/test_finished'
|
20
|
-
require 'test_bench_bootstrap/test_bench/output/controls/events/context_started'
|
21
|
-
require 'test_bench_bootstrap/test_bench/output/controls/events/context_finished'
|
22
|
-
require 'test_bench_bootstrap/test_bench/output/controls/events/file_queued'
|
23
|
-
require 'test_bench_bootstrap/test_bench/output/controls/events/file_executed'
|
24
|
-
require 'test_bench_bootstrap/test_bench/output/controls/events/file_not_found'
|
25
|
-
|
26
|
-
require 'test_bench_bootstrap/test_bench/output/controls/event'
|
@@ -1,46 +0,0 @@
|
|
1
|
-
module TestBenchBootstrap
|
2
|
-
module TestBench
|
3
|
-
class Output
|
4
|
-
module DetailPolicy
|
5
|
-
Error = Class.new(RuntimeError)
|
6
|
-
|
7
|
-
def self.failure
|
8
|
-
:failure
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.on
|
12
|
-
:on
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.off
|
16
|
-
:off
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.detail?(detail_policy, result=nil)
|
20
|
-
result ||= Session::Result.none
|
21
|
-
|
22
|
-
case detail_policy
|
23
|
-
when failure
|
24
|
-
[
|
25
|
-
Session::Result.failed,
|
26
|
-
Session::Result.aborted
|
27
|
-
].include?(result)
|
28
|
-
|
29
|
-
when on
|
30
|
-
true
|
31
|
-
|
32
|
-
when off
|
33
|
-
false
|
34
|
-
|
35
|
-
else
|
36
|
-
raise Error, "Incorrect detail policy: #{detail_policy.inspect}"
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def self.assure_policy(detail_policy)
|
41
|
-
detail?(detail_policy)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|