Sha256: cf455717f57b7c2359ebea1e03ac9b1bbf651720b0c17a0b033f88b2006eff4c
Contents?: true
Size: 998 Bytes
Versions: 1
Compression:
Stored size: 998 Bytes
Contents
require 'spec_helper' require 'compo' require 'url_finder_shared_examples' describe Compo::Finders::Url do subject { Compo::Finders::Url } describe '.find' do context 'when given a nil root' do specify { expect { |b| subject.find(nil, 'a/b/1', &b) }.to raise_error } end it_behaves_like 'a URL finding' do let(:target) { Compo::Branches::Leaf.new } let(:root) do s = Compo::Branches::Hash.new a = Compo::Branches::Hash.new b = Compo::Branches::Array.new d = Compo::Branches::Leaf.new e = Compo::Branches::Leaf.new zero = Compo::Branches::Leaf.new s.add('a', a) a.add('b', b) b.add(0, zero) b.add(1, target) s.add('d', d) a.add('e', e) s end let(:correct_url) { 'a/b/1' } let(:incorrect_url) { 'a/z/1' } let(:proc) do ->(*args, &b) { Compo::Finders::Url.find(root, *args, &b) } end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
compo-0.4.0 | spec/url_finder_spec.rb |