# frozen_string_literal: true require "spec_helpers" describe Wayfarer::Routing::Route do let(:route) { Wayfarer::Routing::RootRoute.new } describe "#matcher" do subject(:matcher) { route.matcher } context "with child routes" do before { route.host("http://google.com") } it "returns true" do %w[http://example.com http://w3c.org http://google.com].each do |url| expect(matcher).to match(Addressable::URI.parse(url)) end end end context "without child routes" do it "returns false" do %w[http://example.com http://w3c.org http://google.com].each do |url| expect(matcher).not_to match(Addressable::URI.parse(url)) end end end end end