diff --git a/CHANGELOG.md b/CHANGELOG.md index c1e6fa69..1db71f5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ only add here if you are working on a PR ### Added ### Fixed +- Fixed grammar in duration message to use singular "second" when appropriate (e.g., "Took 1 second" instead of "Took 1 seconds") ## 5.5.0 - 2025-10-30 diff --git a/lib/parallel_tests/cli.rb b/lib/parallel_tests/cli.rb index 5d40218d..3fe7a0b7 100644 --- a/lib/parallel_tests/cli.rb +++ b/lib/parallel_tests/cli.rb @@ -436,7 +436,7 @@ def execute_command_in_parallel(command, num_processes, options) def report_time_taken(&block) seconds = ParallelTests.delta(&block).to_i - puts "\nTook #{seconds} seconds#{detailed_duration(seconds)}" + puts "\nTook #{pluralize(seconds, 'second')}#{detailed_duration(seconds)}" end def detailed_duration(seconds) diff --git a/spec/integration_spec.rb b/spec/integration_spec.rb index a51069a3..6938aa9a 100644 --- a/spec/integration_spec.rb +++ b/spec/integration_spec.rb @@ -112,7 +112,7 @@ def self.it_runs_the_default_folder_if_it_exists(type, test_folder) expect(result).to include_exactly_times('1 example, 0 failure', 2) # 2 results expect(result).to include_exactly_times('2 examples, 0 failures', 1) # 1 summary expect(result).to include_exactly_times(/Finished in \d+(\.\d+)? seconds/, 2) - expect(result).to include_exactly_times(/Took \d+ seconds/, 1) # parallel summary + expect(result).to include_exactly_times(/Took \d+ seconds?/, 1) # parallel summary # verify empty groups are discarded. if retained then it'd say 4 processes for 2 specs expect(result).to include '2 processes for 2 specs, ~ 1 spec per process'