test/yao/test_client.rb in yao-0.3.1 vs test/yao/test_client.rb in yao-0.3.2

- old
+ new

@@ -53,6 +53,18 @@ def test_timeout stub(Yao.config).timeout { 300 } cli = Yao::Client.gen_client("http://cool-api.example.com:12345/v3.0") assert { cli.options.timeout == 300 } end + + def test_cert_key + stub(Yao.config).client_cert { File.expand_path("../../fixtures/dummy.pem", __FILE__) } + stub(Yao.config).client_key { File.expand_path("../../fixtures/dummy.key", __FILE__) } + stub(OpenSSL::X509::Certificate).new { "DummyCert" } + stub(OpenSSL::PKey).read { "DummyKey" } + + cli = Yao::Client.gen_client("http://cool-api.example.com:12345/v3.0") + ssl = cli.ssl + assert { ssl[:client_cert] == "DummyCert" } + assert { ssl[:client_key] == "DummyKey" } + end end