Skip to content

Commit 506f3f3

Browse files
committed
test: ensure clearing resources
1 parent f317a31 commit 506f3f3

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

test/test_server.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ def test_port
1515
s.add_handler('test.add') { |a, b| a + b }
1616
srv_thread = Thread.new { s.serve }
1717

18-
c = XMLRPC::Client.new('127.0.0.1', '/', s.port)
19-
assert_equal(7, c.call('test.add', 3, 4))
20-
21-
s.shutdown
22-
srv_thread.kill
18+
begin
19+
c = XMLRPC::Client.new('127.0.0.1', '/', s.port)
20+
assert_equal(7, c.call('test.add', 3, 4))
21+
ensure
22+
s.shutdown
23+
srv_thread.kill
24+
end
2325
end
2426
end
2527
end

0 commit comments

Comments
 (0)