Sha256: b94368013afd09af691c75dd00cd2c0233d65bc1e0b84ff1234d1bafb9de6659

Contents?: true

Size: 718 Bytes

Versions: 3

Compression:

Stored size: 718 Bytes

Contents

require 'spec_helper'
require 'ronin/web/middleware/filters/path_filter'

describe Web::Middleware::Filters::PathFilter do
  subject { Web::Middleware::Filters::PathFilter }

  before(:each) do
    @request = mock('request')
    @request.should_receive(:path).and_return('/path/sub/dir')
  end

  it "should match requests using an absolute path" do
    filter = subject.new('/path/sub')

    filter.match?(@request).should == true
  end

  it "should match requests using an path fragment" do
    filter = subject.new('sub/dir')

    filter.match?(@request).should == true
  end

  it "should match requests using a Regexp" do
    filter = subject.new(/\/sub\//)

    filter.match?(@request).should == true
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ronin-web-0.3.0.rc1 spec/web/middleware/filters/path_filter_spec.rb
ronin-web-0.3.0.pre2 spec/web/middleware/filters/path_filter_spec.rb
ronin-web-0.3.0.pre1 spec/web/middleware/filters/path_filter_spec.rb