Sha256: f5af86a4eedbd1b45eacb33c445468ec24353c741a82d54148b5853e2ea16dfb
Contents?: true
Size: 793 Bytes
Versions: 19
Compression:
Stored size: 793 Bytes
Contents
$LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'hx' require 'ostruct' require 'rspec' begin require 'rubygems' rescue LoadError end class FakeInput include Hx::Filter def initialize @entries = {} end def add_entry(path, content, metadata={}) entry = metadata.dup entry['content'] = content @entries[path] = entry end def each_entry_path(selector) @entries.each_key { |path| yield path if selector.accept_path? path } self end def get_entry(path) begin @entries.fetch(path) rescue IndexError raise Hx::NoSuchEntryError, path end end end RSpec::Matchers.define :accept_path do |value| match do |acceptor| acceptor.accept_path?(value) end end
Version data entries
19 entries across 19 versions & 1 rubygems