Skip to content

Commit ba33153

Browse files
Copilotjonrohan
andcommitted
Improve error handling in assert_allocations_helper for unmapped Ruby versions
Co-authored-by: jonrohan <54012+jonrohan@users.noreply.github.com>
1 parent e8ff9d9 commit ba33153

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/test_helpers/assert_allocations_helper.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ def assert_allocations(count_map, &block)
1212
total = trace.allocations.all.size
1313
count = count_map[ruby_version]
1414

15+
if count.nil?
16+
raise "No allocation count mapped for Ruby version #{ruby_version}. " \
17+
"Available versions: #{count_map.keys.sort.join(', ')}. " \
18+
"Actual allocations: #{total}"
19+
end
20+
1521
assert_equal count, total, "Expected #{count} allocations, got #{total} allocations"
1622
end
1723

0 commit comments

Comments
 (0)