Sha256: e347673dddc3466e3fdd16a17a956b2734da4a8f3fca13f4c34adc40bf82d0c3
Contents?: true
Size: 1.07 KB
Versions: 22
Compression:
Stored size: 1.07 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') require 'hx' describe Hx::Overlay do before(:each) do @a = FakeInput.new @a.add_entry('foo', 'foo:A') @a.add_entry('bar', 'bar:A') @b = FakeInput.new @b.add_entry('bar', 'bar:B') @b.add_entry('baz', 'baz:B') @overlay = Hx::Overlay.new(@a, @b) end it "should return itself from each_entry" do @overlay.each_entry(Hx::Path::ALL) {}.should == @overlay end it "should expose the union of paths" do actual_paths = [] @overlay.each_entry(Hx::Path::ALL) do |path, entry| actual_paths << path end actual_paths.sort.should == %w(foo bar baz).sort end it "should give earlier sources precedence" do @overlay.each_entry(Hx::Path::ALL) do |path, entry| entry.should == @a.get_entry('bar') if path == 'bar' end end it "should expose entries from all sources" do @overlay.each_entry(Hx::Path::ALL) do |path, entry| entry.should == @a.get_entry('foo') if path == 'foo' entry.should == @b.get_entry('baz') if path == 'baz' end end end
Version data entries
22 entries across 22 versions & 1 rubygems
Version | Path |
---|---|
hx-0.8.3 | spec/overlay_spec.rb |
hx-0.8.2 | spec/overlay_spec.rb |