test_bench-bootstrap 4.0.0 → 4.0.1
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 +12 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd267192ab849cfd01355201251e06a7a04b967a9738d28b458bb29b99bce080
|
4
|
+
data.tar.gz: b8d64331eda79e450faddfd50b1b80e76b8570e549aa8d32f62b543a16a47532
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d28ec437fbfd2cfe6a02318a8887590400343f3f5589f00001196a312f1577ecf937cbfefb83d297a92f34057882a046f2374e399f2e228aef3306c3742f7f91
|
7
|
+
data.tar.gz: 857c18b0168eda3fd9900931081ec96641d89ff1ea298bd5e4aca1741d2139699c5ba434d70a6ea43618d13bf8e6605fd1ef7ff3861d89e385ffb12a40f9669f
|
data/lib/test_bench/bootstrap.rb
CHANGED
@@ -107,14 +107,14 @@ module TestBench
|
|
107
107
|
raise AssertionFailure.build(1)
|
108
108
|
end
|
109
109
|
|
110
|
-
def context(
|
110
|
+
def context(title=nil, &block)
|
111
111
|
if block.nil?
|
112
|
-
Output.write(
|
112
|
+
Output.write(title || 'Context', sgr_code: 0x33)
|
113
113
|
return
|
114
114
|
end
|
115
115
|
|
116
|
-
unless
|
117
|
-
Output.indent(
|
116
|
+
unless title.nil?
|
117
|
+
Output.indent(title, sgr_code: 0x32) do
|
118
118
|
context(&block)
|
119
119
|
end
|
120
120
|
return
|
@@ -123,30 +123,30 @@ module TestBench
|
|
123
123
|
block.()
|
124
124
|
end
|
125
125
|
|
126
|
-
def _context(
|
127
|
-
context(
|
126
|
+
def _context(title=nil, &block)
|
127
|
+
context(title)
|
128
128
|
end
|
129
129
|
|
130
|
-
def test(
|
130
|
+
def test(title=nil, &block)
|
131
131
|
if block.nil?
|
132
|
-
Output.write(
|
132
|
+
Output.write(title || 'Test', sgr_code: 0x33)
|
133
133
|
return
|
134
134
|
end
|
135
135
|
|
136
136
|
begin
|
137
137
|
block.()
|
138
138
|
|
139
|
-
Output.indent(
|
139
|
+
Output.indent(title, sgr_code: 0x32)
|
140
140
|
|
141
141
|
rescue => error
|
142
|
-
Output.indent(
|
142
|
+
Output.indent(title || 'Test', sgr_codes: [0x1, 0x31])
|
143
143
|
|
144
144
|
raise error
|
145
145
|
end
|
146
146
|
end
|
147
147
|
|
148
|
-
def _test(
|
149
|
-
test(
|
148
|
+
def _test(title=nil, &block)
|
149
|
+
test(title)
|
150
150
|
end
|
151
151
|
|
152
152
|
def comment(text)
|