Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/webmock/request_pattern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def create_uri_pattern(uri)

class MethodPattern
def initialize(pattern)
@pattern = pattern
@pattern = pattern.to_sym
end

def matches?(method)
Expand Down
5 changes: 5 additions & 0 deletions spec/unit/request_pattern_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ def match(request_signature)
to match(WebMock::RequestSignature.new(:get, "www.example.com"))
end

it "should match if method is described as string" do
expect(WebMock::RequestPattern.new("any", "www.example.com")).
to match(WebMock::RequestSignature.new(:get, "www.example.com"))
end

it "should match if request has unescaped uri" do
expect(WebMock::RequestPattern.new(:get, "www.example.com/my%20path")).
to match(WebMock::RequestSignature.new(:get, "www.example.com/my path"))
Expand Down