Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Disable SSL session reuse when artifice is present. Fixes #29

  • Loading branch information...
commit fae5b5870ebf7c05ccc983222a5bd1b909760b1f 1 parent f5d4c74
@drbrain authored
View
2  History.txt
@@ -5,6 +5,8 @@
determine the idle timeout for a host.
* Added #cert and #key aliases for Net::HTTP compatibility. Pull request
#26 by dlee.
+ * The artifice gem now disables SSL session reuse to prevent breakage of
+ testing frameworks. Pull Request #29 by Christopher Cooke.
=== 2.7 / 2012-06-06
View
2  lib/net/http/persistent.rb
@@ -629,7 +629,7 @@ def finish connection, thread = Thread.current
end
def http_class # :nodoc:
- if [:FakeWeb, :WebMock].any? { |klass| Object.const_defined?(klass) } or
+ if [:Artifice, :FakeWeb, :WebMock].any? { |klass| Object.const_defined?(klass) } or
not @reuse_ssl_sessions then
Net::HTTP
else
View
10 test/test_net_http_persistent.rb
@@ -373,6 +373,16 @@ def test_connection_for_http_class_with_webmock
end
end
+ def test_connection_for_http_class_with_artifice
+ Object.send :const_set, :Artifice, nil
+ c = @http.connection_for @uri
+ assert_instance_of Net::HTTP, c
+ ensure
+ if Object.const_defined?(:Artifice) then
+ Object.send :remove_const, :Artifice
+ end
+ end
+
def test_connection_for_name
http = Net::HTTP::Persistent.new 'name'
uri = URI.parse 'http://example/'
Please sign in to comment.
Something went wrong with that request. Please try again.