test_bench-isolated 2.0.0.5 → 2.0.1.0

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: e459a1635202ab637163b0bf8dc29c1298376ef56ff1a4dcff1298a60ac7560d
4
- data.tar.gz: 9754b43288660c1029f33e7417ae8c26679a7aadc25833882b1ee502e4c505c0
3
+ metadata.gz: ce3c4616782689047188f14c495ac232b470d0e805bf455dcbbd2d8301ed8a0c
4
+ data.tar.gz: 14355e880088815320512a68c7ad2f4baf7dc549c48d052012db82a1fe26733d
5
5
  SHA512:
6
- metadata.gz: acab86b502aa9963e563e6c733117afab0cbda2c540e439edfc4164038229d22f223a9234e30a7d55f8cb4efd71d873dbc29de5beaf0eb5a5476883ed4ca220e
7
- data.tar.gz: 7b2da3427a3b03a67f9e3cb4f9e43bccb22e982a08f2a94fb7b4efbe91d41a7e7fc2dc0edeb95ac2c8ac3409bc020ed54b54c3d567edb89c4b888ae3354895a9
6
+ metadata.gz: 707d6e4274a07fbd65ea1abea6cff250d00e4c0a4eaef9c20617041d0af1d222d4692ac2877f09aea3609e2bb459d35cb06f1dd6771e22c553df52de9c797546
7
+ data.tar.gz: 5f919785a59e8778abee82c1a33a1224d2ec7bff1671fd5049ea6df98c08bc898d1c89c89370248dd567a90505b074a34f83aa09a63e994d858579b7475b66f4
@@ -162,7 +162,7 @@ module TestBenchIsolated
162
162
 
163
163
  env['TEST_BENCH_EXCLUDE_FILE_PATTERN'] = exclude_pattern_text
164
164
 
165
- when '-f', '--only-failure', '--no-only-failure'
165
+ when '-f', '-F', '--only-failure', '--no-only-failure'
166
166
  if not negated?(switch)
167
167
  only_failure_text = 'on'
168
168
  else
@@ -171,6 +171,15 @@ module TestBenchIsolated
171
171
 
172
172
  env['TEST_BENCH_ONLY_FAILURE'] = only_failure_text
173
173
 
174
+ when '-p', '-P', '--require-passing-tests', '--no-require-passing-tests'
175
+ if not negated?(switch)
176
+ require_passing_tests = 'on'
177
+ else
178
+ require_passing_tests = 'off'
179
+ end
180
+
181
+ env['TEST_BENCH_REQUIRE_PASSING_TESTS'] = require_passing_tests
182
+
174
183
  when '-o', '--output-styling'
175
184
  output_styling_text = switch_value(argument_index) do
176
185
  'on'
@@ -238,7 +247,11 @@ module TestBenchIsolated
238
247
  end
239
248
 
240
249
  def negated?(switch)
241
- switch.start_with?('--no-')
250
+ if switch.start_with?('--')
251
+ switch.start_with?('--no-')
252
+ else
253
+ /^-[A-Z]/.match?(switch)
254
+ end
242
255
  end
243
256
 
244
257
  def exit_code?
@@ -68,7 +68,17 @@ module TestBenchIsolated
68
68
  end
69
69
 
70
70
  def passed?
71
- asserted? && !failed? && !skipped?
71
+ if failed?
72
+ false
73
+ elsif require_passing_test?
74
+ asserted? && !skipped?
75
+ else
76
+ true
77
+ end
78
+ end
79
+
80
+ def require_passing_test?
81
+ Defaults.require_passing_tests
72
82
  end
73
83
 
74
84
  def fixture(name, &block)
@@ -238,6 +248,12 @@ module TestBenchIsolated
238
248
  def self.no_assertion_message
239
249
  "Test didn't perform an assertion"
240
250
  end
251
+
252
+ module Defaults
253
+ def self.require_passing_tests
254
+ ENV.fetch('TEST_BENCH_REQUIRE_PASSING_TEST', 'on') == 'on'
255
+ end
256
+ end
241
257
  end
242
258
  end
243
259
  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.5
4
+ version: 2.0.1.0
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-08-22 00:00:00.000000000 Z
11
+ date: 2023-08-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: nathanladd+github@gmail.com