minor: test fix for mocha 0.10.5 -- new initializer

This commit is contained in:
Tyler Brock 2012-03-01 13:03:52 -05:00
parent 66227e17c8
commit 379c831b8b

View File

@ -238,7 +238,7 @@ class TestConnection < Test::Unit::TestCase
assert !conn.active? assert !conn.active?
# Simulate a dropped connection. # Simulate a dropped connection.
dropped_socket = Mocha::Mock.new dropped_socket = mock('dropped_socket')
dropped_socket.stubs(:read).raises(Errno::ECONNRESET) dropped_socket.stubs(:read).raises(Errno::ECONNRESET)
dropped_socket.stubs(:send).raises(Errno::ECONNRESET) dropped_socket.stubs(:send).raises(Errno::ECONNRESET)
dropped_socket.stub_everything dropped_socket.stub_everything
@ -357,7 +357,7 @@ class TestConnection < Test::Unit::TestCase
end end
should "show a proper exception message if an IOError is raised while closing a socket" do should "show a proper exception message if an IOError is raised while closing a socket" do
fake_socket = Mocha::Mock.new fake_socket = mock('fake_socket')
fake_socket.stubs(:close).raises(IOError.new) fake_socket.stubs(:close).raises(IOError.new)
fake_socket.stub_everything fake_socket.stub_everything
TCPSocket.stubs(:new).returns(fake_socket) TCPSocket.stubs(:new).returns(fake_socket)