require "test/unit" require 'tempfile' $:.unshift File.expand_path(File.dirname(__FILE__) + '/../lib') require "eventmachine" module EventMachine def self._set_mocks class < priv_file) end assert_raise(EventMachine::FileNotFoundException) do conn.start_tls(:cert_chain_file => cert_file) end assert_raise(EventMachine::FileNotFoundException) do conn.start_tls(:private_key_file => priv_file, :cert_chain_file => cert_file) end end def test_tls_params_file_does_exist priv_file = Tempfile.new('em_test') cert_file = Tempfile.new('em_test') priv_file_path = priv_file.path cert_file_path = cert_file.path conn = EventMachine::Connection.new('foo') params = {:private_key_file => priv_file_path, :cert_chain_file => cert_file_path} begin conn.start_tls params rescue Object assert(false, 'should not have raised an exception') end end end