Sha256: 51849445c6451c975e93cedc959f51346aa8aed4cfa3062a9ba16be748bb5f15

Contents?: true

Size: 616 Bytes

Versions: 4

Compression:

Stored size: 616 Bytes

Contents

# Copyright (C) 2016 all contributors <dtas-all@nongnu.org>
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
require './test/helper'
require 'dtas/mcache'

class TestMcache < Testcase
  def test_mcache
    mc = DTAS::Mcache.new
    exist = nil
    mc.lookup('hello') { |infile, hash| exist = hash }
    assert_kind_of Hash, exist
    assert_equal 'hello', exist[:infile]
    assert_operator exist[:btime], :<=, DTAS.now
    assert_same exist, mc.lookup('hello')
    assert_nil mc.lookup('HELLO')
    assert_same exist, mc.lookup('hello'), 'no change after miss'
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dtas-0.17.0 test/test_mcache.rb
dtas-0.16.1 test/test_mcache.rb
dtas-0.16.0 test/test_mcache.rb
dtas-0.15.0 test/test_mcache.rb