test_bench-isolated 2.0.0.2 → 2.0.0.3

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: 823ae0100446761d148f5a0cb6be44b59c80396c303d9cd85fa2f104b86a082f
4
- data.tar.gz: '074783cb5efa89a609c96cebe85cebf1dc4a548f89533d971a766ecc9e1bd856'
3
+ metadata.gz: 116ae637aa2c6479597875939fdb7a6133778abee6224441872f619b7d6997fd
4
+ data.tar.gz: 4240ebfd27180fdc1d7c876d1f5e10e9e5dc528fda3f8754013ce1b4452469de
5
5
  SHA512:
6
- metadata.gz: 2ce9fe68b17ef642bb5e21e7b4c022db68f50c2cbbdd83ee4198b6eb74318336ee0ff37843d7ef1da5e12cbb3587021faaf5f0eeca97ec709b709359303d74be
7
- data.tar.gz: bb69c669cbb91fd5798e1ef9d6e0a1b09e79bc7b975858257951c386fb1d02d2468ae205ebcee388dd9e2501ada1eedae8e52636652a425cac33a76625abbd11
6
+ metadata.gz: ff36269a0129363eaaa1e7d727b439f44937b8a0c54f85c10159e6a47bdd9338018ab8773da9aa0d6dfd904b0889b36e11299d361cb7efe304e2da22cb83bf63
7
+ data.tar.gz: 7d9dbf18961597a84facb32afec7b5ba83c070209eb787c0eacd72bd49605e4e515cef6b51b4fde6c1afc65bc56dd25f5f703564a5ad29f8b87671c655ae7565
@@ -148,12 +148,19 @@ module TestBenchIsolated
148
148
 
149
149
  when '-x', '--exclude', '--no-exclude'
150
150
  if not negated?(switch)
151
- exclude_file_pattern_text = switch_value!(argument_index, switch)
151
+ exclude_pattern_text = switch_value!(argument_index, switch)
152
+
153
+ if env.key?('TEST_BENCH_EXCLUDE_FILE_PATTERN')
154
+ exclude_pattern_text = [
155
+ env['TEST_BENCH_EXCLUDE_FILE_PATTERN'],
156
+ exclude_pattern_text
157
+ ].join(':')
158
+ end
152
159
  else
153
- exclude_file_pattern_text = ''
160
+ exclude_pattern_text = ''
154
161
  end
155
162
 
156
- env['TEST_BENCH_EXCLUDE_FILE_PATTERN'] = exclude_file_pattern_text
163
+ env['TEST_BENCH_EXCLUDE_FILE_PATTERN'] = exclude_pattern_text
157
164
 
158
165
  when '-f', '--only-failure', '--no-only-failure'
159
166
  if not negated?(switch)
@@ -206,7 +213,7 @@ module TestBenchIsolated
206
213
 
207
214
  Configuration Options:
208
215
  \t-d, --[no]detail Always show (or hide) details (Default: #{Session::Output::Detail.default})
209
- \t-x, --[no-]exclude PATTERN Do not execute test files matching PATTERN (Default: #{Run::GetFiles::Defaults.exclude_file_pattern.inspect})
216
+ \t-x, --[no-]exclude PATTERN Do not execute test files matching PATTERN (Default: #{Run::GetFiles::Defaults.exclude_patterns.inspect})
210
217
  \t-f, --[no-]only-failure Don't display output for test files that pass (Default: #{Run::Output::File::Defaults.only_failure ? 'on' : 'off'})
211
218
  \t-o, --output-styling [on|off|detect]
212
219
  \t Render output coloring and font styling escape codes (Default: #{Output::Writer::Styling.default})
@@ -15,7 +15,7 @@ module TestBenchIsolated
15
15
  exclude_patterns ||= Defaults.exclude_patterns
16
16
 
17
17
  if exclude_patterns.instance_of?(String)
18
- exclude_patterns = exclude_patterns.split(',')
18
+ exclude_patterns = exclude_patterns.split(':')
19
19
  end
20
20
 
21
21
  new(exclude_patterns)
@@ -35,7 +35,7 @@ module TestBenchIsolated
35
35
  end
36
36
  attr_writer :path_sequence
37
37
 
38
- def self.build(exclude: nil)
38
+ def self.build(exclude: nil, session: nil)
39
39
  instance = new
40
40
 
41
41
  GetFiles.configure(instance, exclude:)
@@ -44,14 +44,16 @@ module TestBenchIsolated
44
44
 
45
45
  Random.configure(instance)
46
46
 
47
- session = Session.build do |telemetry|
48
- Output::File.register(telemetry)
49
- Output::Summary::Error.register(telemetry)
50
- Output::Summary.register(telemetry)
51
-
52
- instance.telemetry = telemetry
47
+ if session.nil?
48
+ session = Session.build do |telemetry|
49
+ Output::File.register(telemetry)
50
+ Output::Summary::Error.register(telemetry)
51
+ Output::Summary.register(telemetry)
52
+ end
53
53
  end
54
54
 
55
+ instance.telemetry = session.telemetry
56
+
55
57
  Session.configure(instance, session:)
56
58
 
57
59
  instance
@@ -67,10 +69,10 @@ module TestBenchIsolated
67
69
  instance.(path)
68
70
  end
69
71
 
70
- def self.configure(receiver, exclude: nil, attr_name: nil)
72
+ def self.configure(receiver, exclude: nil, session: nil, attr_name: nil)
71
73
  attr_name ||= :run
72
74
 
73
- instance = build(exclude:)
75
+ instance = build(exclude:, session:)
74
76
  receiver.public_send(:"#{attr_name}=", instance)
75
77
  end
76
78
 
@@ -44,6 +44,29 @@ module TestBenchIsolated
44
44
  receiver.public_send(:"#{attr_name}=", instance)
45
45
  end
46
46
 
47
+ def inspect
48
+ text = self.to_s
49
+
50
+ instance_variables = self.instance_variables - [:@telemetry]
51
+
52
+ instance_variables.each_with_index do |name, index|
53
+ ivar_text = String.new
54
+
55
+ if index > 0
56
+ ivar_text << ','
57
+ end
58
+
59
+ value = instance_variable_get(name)
60
+ value = value.inspect
61
+
62
+ ivar_text << " #{name}=#{value}"
63
+
64
+ text.insert(-2, ivar_text)
65
+ end
66
+
67
+ text
68
+ end
69
+
47
70
  def passed?
48
71
  asserted? && !failed? && !skipped?
49
72
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_bench-isolated
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.2
4
+ version: 2.0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Ladd
8
8
  autorequire:
9
9
  bindir: script
10
10
  cert_chain: []
11
- date: 2023-07-28 00:00:00.000000000 Z
11
+ date: 2023-08-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: nathanladd+github@gmail.com