Skip to content

Commit

Permalink
Merge branch 'master' into regexes
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisk committed Jun 15, 2009
2 parents 4403b08 + 847c3f7 commit 541dcbd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/fake_web.rb
Expand Up @@ -97,7 +97,7 @@ class NetConnectNotAllowedError < StandardError; end;
# Passing <tt>:status</tt> as a two-value array will set the response code
# and message. The defaults are <tt>200</tt> and <tt>OK</tt>, respectively.
# Example:
# FakeWeb.register_uri('http://www.example.com/', :response => "Go away!", :status => [ 404, "Not Found" ])
# FakeWeb.register_uri("http://www.example.com/", :body => "Go away!", :status => [404, "Not Found"])
# <tt>:exception</tt>::
# The argument passed via <tt>:exception</tt> will be raised when the
# specified URL is requested. Any +Exception+ class is valid. Example:
Expand Down
6 changes: 3 additions & 3 deletions test/test_fake_authentication.rb
Expand Up @@ -25,21 +25,21 @@ def test_register_uri_with_authentication_doesnt_trigger_with_incorrect_credenti
def test_unauthenticated_request
http = Net::HTTP.new('mock', 80)
req = Net::HTTP::Get.new('/auth.txt')
assert_equal http.request(req).body, 'unauthorized'
assert_equal 'unauthorized', http.request(req).body
end

def test_authenticated_request
http = Net::HTTP.new('mock',80)
req = Net::HTTP::Get.new('/auth.txt')
req.basic_auth 'user', 'pass'
assert_equal http.request(req).body, 'authorized'
assert_equal 'authorized', http.request(req).body
end

def test_incorrectly_authenticated_request
http = Net::HTTP.new('mock',80)
req = Net::HTTP::Get.new('/auth.txt')
req.basic_auth 'user2', 'pass'
assert_equal http.request(req).body, 'wrong user'
assert_equal 'wrong user', http.request(req).body
end

def test_basic_auth_support_is_transparent_to_oauth
Expand Down
2 changes: 1 addition & 1 deletion test/test_fake_web.rb
Expand Up @@ -115,7 +115,7 @@ def test_response_for_with_registered_uri
end

def test_response_for_with_unknown_uri
assert_equal nil, FakeWeb.response_for(:get, 'http://example.com/')
assert_nil FakeWeb.response_for(:get, 'http://example.com/')
end

def test_response_for_with_put_method
Expand Down

0 comments on commit 541dcbd

Please sign in to comment.