test_bench 1.2.0.6 → 1.2.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 401590086df82ac9a8f1b1986ee18e2d16c50fc853906bdd048a0dfdb83e6f9f
4
- data.tar.gz: 065c9f7af87e614ccc0377f7d3a3baf3f31081cadd6293435d53ea2f93fc1077
3
+ metadata.gz: 05441cb83eef17edb08808484675951fdaeedcf33d3b60e77fe7a42d9810d995
4
+ data.tar.gz: c64e1a00db231505654bf87a9f12329b55de83a72983b581cc2f0a6003f02fd0
5
5
  SHA512:
6
- metadata.gz: d8cf556067bf2a71e11e1401b8dd476143b7d775cf2fb7315612b9e422fc113d135556f711f6c26a39c4a43794a3cf2455f50c15d74e02fbda22a67334db1390
7
- data.tar.gz: a1abc311463834f6a037a0e870a65a74fcd2daa02775a6b8d432335f75c2ee113084b311d70d8fac56d23567ea5481c806b92823d4fe9d9666bb6b40a12f4c8b
6
+ metadata.gz: a00af27a3e6821af9b8fe4116b1be23dba6b8253266d8e17d23c176a4ef936cc64e31ba0b5c58c8cab0021044e0b9a8f9405c0fde30770e27390005179a5ce40
7
+ data.tar.gz: 114f737345753f230865a4957757409308f3d3d780844a4b1edc9c4d9b8f57f0ec7fcf25315dac8e4011774d8e687edea8741c5272a68427e2d5c724c3fd70f6
@@ -66,7 +66,7 @@ TEXT
66
66
  env['TEST_BENCH_ABORT_ON_ERROR'] = abort_on_error ? 'on' : 'off'
67
67
  end
68
68
 
69
- parser.on('-d', '--[no-]detail [DETAIL]', %{Always show (or hide) details (Default: #{Output::Raw::Defaults.detail})}) do |detail|
69
+ parser.on('-d', '--[no-]detail', %{Always show (or hide) details (Default: #{Output::Raw::Defaults.detail})}) do |detail|
70
70
  if detail.nil?
71
71
  detail = 'on'
72
72
  elsif detail == true
@@ -199,12 +199,22 @@ module TestBench
199
199
 
200
200
  color = result ? :green : :red
201
201
 
202
- writer
203
- .indent
204
- .escape_code(color)
205
- .text(text)
206
- .escape_code(:reset_fg)
207
- .newline
202
+ writer.indent
203
+
204
+ if result
205
+ writer.escape_code(:green)
206
+ else
207
+ writer.escape_code(:bold).escape_code(:red)
208
+ end
209
+
210
+ writer.text(text)
211
+
212
+ writer.escape_code(:reset_fg)
213
+ unless result
214
+ writer.escape_code(:reset_intensity)
215
+ end
216
+
217
+ writer.newline
208
218
  end
209
219
 
210
220
  def skip_test(title)
@@ -39,14 +39,24 @@ module TestBench
39
39
  instance
40
40
  end
41
41
 
42
- def self.call(*paths, **args, &block)
43
- instance = build(*paths, **args)
42
+ def self.call(*paths, session: nil, **args, &block)
43
+ instance = build(*paths, session: session, **args)
44
44
 
45
45
  if block.nil?
46
46
  instance.()
47
47
  else
48
48
  instance.() do
49
+ unless session.nil?
50
+ original_session = TestBench.session
51
+ TestBench.session = session
52
+ end
53
+
49
54
  block.(instance)
55
+
56
+ ensure
57
+ unless original_session.nil?
58
+ TestBench.session = original_session
59
+ end
50
60
  end
51
61
  end
52
62
  end
@@ -83,7 +83,7 @@ module TestBench
83
83
 
84
84
  if session.failed?
85
85
  1
86
- elsif session.skip?
86
+ elsif session.skipped?
87
87
  fail_deactivated_tests ? 2 : 0
88
88
  else
89
89
  0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_bench
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0.6
4
+ version: 1.2.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Ladd
8
8
  autorequire:
9
9
  bindir: script
10
10
  cert_chain: []
11
- date: 2021-04-05 00:00:00.000000000 Z
11
+ date: 2022-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test_bench-fixture
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  - !ruby/object:Gem::Version
112
112
  version: '0'
113
113
  requirements: []
114
- rubygems_version: 3.1.4
114
+ rubygems_version: 3.3.4
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: Principled Test Framework for Ruby and MRuby