tryouts 3.7.0 → 3.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7178f4f14ad2015fb3e5a795bbdd7813b4a184b56413535d7ddfff569badca9d
4
- data.tar.gz: ff451b947073ebfbaece457e3b94cb090410ff86aa8ca09e8fdc8c998e04118c
3
+ metadata.gz: d3934c079df9042f8ef837ea6eb7dc14a04706a1fcba4853d26a5f1ce69672bf
4
+ data.tar.gz: adf6be71e206ad4747f83268370772ffdaeddfc6a9b49576bbd74cb6cf9b650c
5
5
  SHA512:
6
- metadata.gz: d15d3afd82d4cef85ffe9eb481b5bfd68971c2cbc4247f8f6b46fbf53e7292ae6d22d396b1b2070481f0034c12079f8183ff66903a05f6a36dc754a7b33aef55
7
- data.tar.gz: 936ecb57906f16befe499de544032e9f1cd25ed50f757652556f357ac80b6ff7d14dbb3787c8ff2eb2d93460f3c59a224eecbc2b491a936038394013976a3b42
6
+ metadata.gz: d88b6998f1bd4d35329f501f4cbf710d1f653ca3faece95bc88c89ef626e6fe1413bd0129890817ff5d4cc15341e8c7bebd1209056cfc4fbd8bb730dc3ef4574
7
+ data.tar.gz: 3d919417a2bc28cebb759a77a340bd2dd996ed290de6a7b96c2fe40f4936d5df6d952242b6991fb12d34646e325699f0837f817fc5aa2b6e03257e6d903a541c
@@ -89,10 +89,11 @@ class Tryouts
89
89
  end
90
90
 
91
91
  def file_parsed(_file_path, test_count:, setup_present: false, teardown_present: false)
92
+ # Store per-file parsed test count for reference
93
+ # Total executed tests come from TestResultAggregator via grand_total()
92
94
  if @current_file_data
93
95
  @current_file_data[:tests] = test_count
94
96
  end
95
- @total_stats[:tests] += test_count
96
97
  end
97
98
 
98
99
  def parser_warnings(file_path, warnings:)
@@ -117,9 +118,7 @@ class Tryouts
117
118
  end
118
119
 
119
120
  def file_result(file_path, total_tests:, failed_count:, error_count:, elapsed_time: nil)
120
- # Always update global totals
121
- @total_stats[:failures] += failed_count
122
- @total_stats[:errors] += error_count
121
+ # Update elapsed time (other stats come from TestResultAggregator via grand_total)
123
122
  @total_stats[:elapsed_time] += elapsed_time if elapsed_time
124
123
 
125
124
  # Update per-file data - file_result is called AFTER file_end, so data is in @collected_files
@@ -168,24 +167,19 @@ class Tryouts
168
167
 
169
168
  # Summary operations - reliable trigger for rendering
170
169
  def batch_summary(failure_collector)
171
- # This becomes the single, reliable trigger for rendering
172
- grand_total(
173
- total_tests: @total_stats[:tests],
174
- failed_count: @collected_files.sum { |f| f[:failures].size },
175
- error_count: @collected_files.sum { |f| f[:errors].size },
176
- successful_files: @collected_files.size - @collected_files.count { |f| f[:failures].any? || f[:errors].any? },
177
- total_files: @collected_files.size,
178
- elapsed_time: @total_stats[:elapsed_time]
179
- ) unless @output_rendered
170
+ # NOTE: We don't render here because test_runner.rb calls grand_total directly
171
+ # with accurate counts from the TestResultAggregator
180
172
  end
181
173
 
182
174
  def grand_total(total_tests:, failed_count:, error_count:, successful_files:, total_files:, elapsed_time:)
183
175
  return if @output_rendered # Prevent double rendering
184
176
 
177
+ # Use the accurate counts from TestResultAggregator (passed as parameters)
178
+ # NOT the parsed counts we accumulated in file_parsed()
185
179
  @total_stats.merge!(
186
- tests: total_tests,
187
- failures: failed_count,
188
- errors: error_count,
180
+ tests: total_tests, # Actual executed test count from aggregator
181
+ failures: failed_count, # Actual failures from aggregator
182
+ errors: error_count, # Actual errors from aggregator
189
183
  successful_files: successful_files,
190
184
  total_files: total_files,
191
185
  elapsed_time: elapsed_time,
@@ -73,17 +73,18 @@ class Tryouts
73
73
  #=1> STDOUT content #=2> STDERR content #=<> Intentional failure
74
74
 
75
75
  Exception Testing:
76
- # Method 1: Rescue and test exception
76
+ ## Method 1: Rescue and test exception
77
77
  begin
78
78
  risky_operation
79
- rescue StandardError => e
79
+ rescue MySpecificError => e
80
80
  e.class
81
81
  end
82
- #=> StandardError
82
+ #=> MySpecificError
83
83
 
84
- # Method 2: Let it raise and test with #=!>
84
+ ## Method 2: Let it raise and test with #=!> and #=~>
85
85
  risky_operation
86
- #=!> error.is_a?(StandardError)
86
+ #=!> MySpecificError
87
+ #=~> /Could not complete action/
87
88
  HELP
88
89
 
89
90
  class << self
@@ -1,5 +1,5 @@
1
1
  # lib/tryouts/version.rb
2
2
 
3
3
  class Tryouts
4
- VERSION = '3.7.0'
4
+ VERSION = '3.7.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tryouts
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.0
4
+ version: 3.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delano Mandelbaum