Sha256: ec3a9ed17c4afab3333fdea018bc83a96af37c82b27630e57ebf56feb7a5c03e
Contents?: true
Size: 1004 Bytes
Versions: 2
Compression:
Stored size: 1004 Bytes
Contents
require 'spec_helper' require 'compo' require 'url_finder_shared_examples' RSpec.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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
compo-0.5.1 | spec/url_finder_spec.rb |
compo-0.5.0 | spec/url_finder_spec.rb |