test_bench-bootstrap 4.1.1 → 6.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/test_bench/bootstrap.rb +30 -7
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 034501d841e885c9b6b23e6ffbfad13500c462e2ccfc8e857c7ae20159addef1
4
- data.tar.gz: 67d1d9f66753ef560aae204c47213a0637dd7033679354cdf51bd2e8463865bd
3
+ metadata.gz: 8bab482f0b0e6c9bd91cafe2eda531743d77bb46c67bc9ace7cc3d0b5d29048e
4
+ data.tar.gz: 39f9bc31bd52f88621e13a6df81fd8f709ba62366aa4dbfd82acbba4d823324f
5
5
  SHA512:
6
- metadata.gz: 268bfa7119bcbac364c84b9079bb008ef7e7a8f51a04b61e25d280a293e2b77cece5026c88a56944758116e4091dd726676855e7da27c865d402e053f78eefe4
7
- data.tar.gz: 6ed3766f69809dc07fa376f3fd06c7cced6c7b6b2fcd5d9aa519dbd7a89049f00e1affa1a831e9e429a1eff59936abcbead64d6eaabcb34bdc9935e950eb7cfe
6
+ metadata.gz: a365bd710e401b38b945b92f22c2aeb23929bd4dd4a1b3a43cb8a3138209816fa9f74076b04ef05f48112bd7855ee34dcd0e7e66106234a2982212b16a91da44
7
+ data.tar.gz: 915db1d6c535c5663d677300ae4b1bde08087fb49b659efd0a565cc063e8cbf0c6683a48ae7580f67ac2fb9f48f85750cacf2050bbddc78b13a7542ec3e82293
@@ -151,16 +151,39 @@ module TestBench
151
151
  test(title)
152
152
  end
153
153
 
154
- def comment(text, *additional_lines)
155
- Output.write(text)
154
+ def comment(comment)
155
+ Output.indent(comment)
156
+ end
157
+
158
+ def detail(detail, *additional_details, quote: nil, heading: nil)
159
+ details = [detail, *additional_details]
156
160
 
157
- additional_lines.each do |line|
158
- comment(line.chomp)
161
+ if quote.nil?
162
+ quote = details.last.end_with?("\n")
159
163
  end
160
- end
161
164
 
162
- def detail(...)
163
- comment(...)
165
+ if quote
166
+ if heading.nil?
167
+ heading = !detail.end_with?("\n")
168
+ end
169
+ end
170
+
171
+ if heading
172
+ heading_text = details.shift
173
+ Output.indent(heading_text, sgr_codes: [0x1, 0x4])
174
+ end
175
+
176
+ details.each do |detail|
177
+ if quote
178
+ detail.each_line do |line|
179
+ line.chomp!
180
+
181
+ Output.indent("\e[2m>\e[22m \e[3m#{line}\e[0m")
182
+ end
183
+ else
184
+ Output.comment(detail)
185
+ end
186
+ end
164
187
  end
165
188
 
166
189
  def fixture(cls, *args, **kwargs, &block)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_bench-bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.1
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Ladd