Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Regexp expectation on request with nil base_url #431

Merged
merged 1 commit into from
Feb 16, 2015
Merged
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/typhoeus/expectation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def url_match?(request_url)
when String
base_url == request_url
when Regexp
!!request_url.match(base_url)
base_url === request_url
when nil
true
else
Expand Down
8 changes: 8 additions & 0 deletions spec/typhoeus/expectation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,14 @@ def construct_response(request)
it "returns false" do
expect(url_match).to be_falsey
end

context "with nil request_url" do
let(:request_url) { nil }

it "returns false" do
expect(url_match).to be_falsey
end
end
end
end

Expand Down