Skip to content

Commit 7d58ec8

Browse files
committed
Check the first Concurrent::Map default_proc argument is a Concurrent::Map in more tests
1 parent f2985bd commit 7d58ec8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

spec/concurrent/map_spec.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,12 +840,18 @@ def key # assert_collision_resistance expects to be able to call .key to get the
840840

841841
def with_or_without_default_proc(&block)
842842
block.call(false)
843-
@cache = Concurrent::Map.new { |h, k| h[k] = :default_value }
843+
@cache = Concurrent::Map.new { |h, k|
844+
expect(h).to be_kind_of(Concurrent::Map)
845+
h[k] = :default_value
846+
}
844847
block.call(true)
845848
end
846849

847850
def cache_with_default_proc(default_value = 1)
848-
Concurrent::Map.new { |cache, k| cache[k] = default_value }
851+
Concurrent::Map.new do |map, k|
852+
expect(map).to be_kind_of(Concurrent::Map)
853+
map[k] = default_value
854+
end
849855
end
850856

851857
def expect_size_change(change, cache = @cache, &block)

0 commit comments

Comments
 (0)