Sha256: 3f6549edab92f4fbb8d46128b3bd2fd6fa28b922fac1708f7ed84f11c33f42c0
Contents?: true
Size: 771 Bytes
Versions: 22
Compression:
Stored size: 771 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') require 'hx' require 'set' describe Hx::Cache do before(:each) do @source = FakeInput.new @source.add_entry('foo', 'BLAH') @source.add_entry('bar', 'EEP') @cache = Hx::Cache.new(@source) end it "should return itself from each_entry" do @cache.each_entry(Hx::Path::ALL) {}.should == @cache end it "enumerates the same entries from the source" do @cache.each_entry(Hx::Path::ALL) do |path, entry| entry.should == @source.get_entry(path) end end it "only reads the source once" do @cache.each_entry(Hx::Path::ALL) {} def @source.each_entry raise RuntimeError, "should not be called" end @cache.each_entry(Hx::Path::ALL) {} end end
Version data entries
22 entries across 22 versions & 1 rubygems