From 63bec51ee2668ea4c39af95de72bbcdaaeb05f4f Mon Sep 17 00:00:00 2001 From: Ilya Lavrov Date: Sun, 26 Apr 2015 22:05:43 +0300 Subject: [PATCH] Add Cache#values spec --- spec/thread_safe/cache_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/thread_safe/cache_spec.rb b/spec/thread_safe/cache_spec.rb index 8a68801..3362751 100644 --- a/spec/thread_safe/cache_spec.rb +++ b/spec/thread_safe/cache_spec.rb @@ -679,6 +679,16 @@ def key # assert_collision_resistance expects to be able to call .key to get the expect([1, 2]).to eq @cache.keys.sort end + it '#values' do + expect([]).to eq @cache.values + + @cache[1] = 1 + expect([1]).to eq @cache.values + + @cache[2] = 2 + expect([1, 2]).to eq @cache.values.sort + end + it '#each_key' do expect(@cache).to eq @cache.each_key { flunk }