test/unit/rack_handler_test.rb in m2r-2.0.2 vs test/unit/rack_handler_test.rb in m2r-2.1.0.pre

- old
+ new

@@ -41,13 +41,15 @@ options = { 'recv_addr' => recv = 'tcp://1.2.3.4:1234', 'send_addr' => send = 'tcp://1.2.3.4:4321', 'sender_id' => id = SecureRandom.uuid } - cf = mock(:connection) + cf = stub() + cf.stubs(:connection => cf, :close => nil) ConnectionFactory.expects(:new).with(responds_with(:sender_id, id)).returns(cf) RackHandler.any_instance.stubs(:stop? => true) + M2R.zmq_context.expects(:terminate) handler.run(HelloWorld.new, options) end def test_lint_rack_adapter factory = stub(:connection) @@ -72,12 +74,14 @@ require 'rack/handler/mongrel2' handler = ::Rack::Handler::Mongrel2 options = { 'connection_factory' => 'custom' } - cf = mock(:connection) + cf = stub() + cf.stubs(:connection => cf, :close => nil) ConnectionFactory::Custom.expects(:new).with(responds_with(:connection_factory, 'custom')).returns(cf) RackHandler.any_instance.stubs(:stop? => true) + M2R.zmq_context.expects(:terminate) handler.run(HelloWorld.new, options) end private