require "test/unit" require 'tempfile' require 'em_test_helper' module EM def self._set_mocks class < priv_file) end assert_raises(EM::FileNotFoundException) do conn.start_tls(:cert_chain_file => cert_file) end assert_raises(EM::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 = EM::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 if EM.ssl?