Skip to content

Commit

Permalink
Fix warnings in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
drbrain committed Oct 25, 2011
1 parent 8d11769 commit 903ce8a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion History.txt
@@ -1,4 +1,4 @@
=== 2.2 / ??
=== 2.2 / 2011-10-24

* Minor Enhancement
* Added timeouts for idle connections which are set through #idle_timeout.
Expand Down
10 changes: 6 additions & 4 deletions test/test_net_http_persistent.rb
Expand Up @@ -190,9 +190,9 @@ def test_connection_for_closed
cached = basic_connection
cached.start
if Socket.const_defined? :TCP_NODELAY then
def (cached.instance_variable_get(:@socket).io).setsockopt(*a)
raise IOError, 'closed stream'
end
io = Object.new
def io.setsockopt(*a) raise IOError, 'closed stream' end
cached.instance_variable_set :@socket, Net::BufferedIO.new(io)
end
conns['example.com:80'] = cached

Expand All @@ -204,7 +204,9 @@ def (cached.instance_variable_get(:@socket).io).setsockopt(*a)
assert_same c, conns['example.com:80']

socket = c.instance_variable_get :@socket
assert_nil socket.io.instance_variable_get(:@setsockopt)

refute_includes socket.io.instance_variables, :@setsockopt
refute_includes socket.io.instance_variables, '@setsockopt'
end

def test_connection_for_debug_output
Expand Down

0 comments on commit 903ce8a

Please sign in to comment.