test/cache_test.rb in lru_redux-0.8.4 vs test/cache_test.rb in lru_redux-1.1.0

- old
+ new

@@ -1,16 +1,16 @@ require 'lru_redux' require 'minitest/autorun' require 'minitest/pride' -class CacheTest < MiniTest::Unit::TestCase +class CacheTest < MiniTest::Test def setup @c = LruRedux::Cache.new(3) end def teardown - assert_equal true, @c.valid? + assert_equal true, @c.send(:valid?) end def test_drops_old @c[:a] = 1 @c[:b] = 2 @@ -68,9 +68,17 @@ @c[:e] = 5 @c[:f] = 6 assert_equal [[:f,6],[:e,5],[:d,4]], @c.to_a assert_nil @c[:b] + end + + def test_key? + @c[:a] = 1 + @c[:b] = 2 + + assert_equal true, @c.key?(:a) + assert_equal false, @c.key?(:c) end def test_update @c[:a] = 1 @c[:b] = 2