Sha256: 65a96aed0e3a35635d0ed6c33def5b03eb94fb4ee3caf7ecccc32d3b7095266c

Contents?: true

Size: 1.04 KB

Versions: 16

Compression:

Stored size: 1.04 KB

Contents

require "spec_helper"

describe WildcardMatchers::Matchers::IsUri do
  [ [ "http://example.com", :is_uri ],
    [ "http://example.com", :is_uri, :scheme => "http", :host => "example.com" ],
    [ "http://example.com", :is_uri, :host => /example/ ],
  ].each do |actual, matcher, *args|
    it_behaves_like "wildcard match", actual, matcher, *args
  end

  [ [ "http://example.com", :is_uri, :host => "google.com" ],
    [ "http://example.com", :is_uri, :host => /google/ ],
  ].each do |actual, matcher, *args|
    it_behaves_like "not wildcard match", actual, matcher, *args
  end

  context "when you use addressable, :query_values also available" do
    [ [ "http://example.com/?hoge=fuga", :is_uri, :query_values => { "hoge" => /fu/ } ],
    ].each do |actual, matcher, *args|
      it_behaves_like "wildcard match", actual, matcher, *args
    end

    [ [ "http://example.com/?hoge=fuga", :is_uri, :query_values => { "hoge" => /ho/ } ],
    ].each do |actual, matcher, *args|
      it_behaves_like "not wildcard match", actual, matcher, *args
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
wildcard_matchers-0.9.2 spec/wildcard_matchers/matchers/is_uri_spec.rb
wildcard_matchers-0.9.1 spec/wildcard_matchers/matchers/is_uri_spec.rb
wildcard_matchers-0.9.0 spec/wildcard_matchers/matchers/is_uri_spec.rb
wildcard_matchers-0.4.0 spec/wildcard_matchers/matchers/is_uri_spec.rb
wildcard_matchers-0.3.1 spec/wildcard_matchers/matchers/is_uri_spec.rb
wildcard_matchers-0.3.0 spec/wildcard_matchers/matchers/is_uri_spec.rb
wildcard_matchers-0.2.1 spec/wildcard_matchers/matchers/is_uri_spec.rb
wildcard_matchers-0.2.0 spec/wildcard_matchers/matchers/is_uri_spec.rb
wildcard_matchers-0.1.8 spec/wildcard_matchers/matchers/is_uri_spec.rb
wildcard_matchers-0.1.7 spec/wildcard_matchers/matchers/is_uri_spec.rb
wildcard_matchers-0.1.6 spec/wildcard_matchers/matchers/is_uri_spec.rb
wildcard_matchers-0.1.5 spec/wildcard_matchers/matchers/is_uri_spec.rb
wildcard_matchers-0.1.4 spec/wildcard_matchers/matchers/is_uri_spec.rb
wildcard_matchers-0.1.3 spec/wildcard_matchers/matchers/is_uri_spec.rb
wildcard_matchers-0.1.2 spec/wildcard_matchers/matchers/is_uri_spec.rb
wildcard_matchers-0.1.1 spec/wildcard_matchers/matchers/is_uri_spec.rb