[前][次][番号順一覧][スレッド一覧]

ruby-changes:35080

From: hsbt <ko1@a...>
Date: Wed, 13 Aug 2014 11:04:00 +0900 (JST)
Subject: [ruby-changes:35080] hsbt:r47162 (trunk): * test/openssl/test_ssl_session.rb: fix indent.

hsbt	2014-08-13 11:03:47 +0900 (Wed, 13 Aug 2014)

  New Revision: 47162

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47162

  Log:
    * test/openssl/test_ssl_session.rb: fix indent.
      contributed from @spk. [fix GH-698]

  Modified files:
    trunk/test/openssl/test_ssl_session.rb
Index: test/openssl/test_ssl_session.rb
===================================================================
--- test/openssl/test_ssl_session.rb	(revision 47161)
+++ test/openssl/test_ssl_session.rb	(revision 47162)
@@ -42,33 +42,33 @@ tddwpBAEDjcwMzA5NTYzMTU1MzAwpQMCARM= https://github.com/ruby/ruby/blob/trunk/test/openssl/test_ssl_session.rb#L42
 
   def test_session
     timeout(5) do
-    start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true) do |server, port|
-      sock = TCPSocket.new("127.0.0.1", port)
-      ctx = OpenSSL::SSL::SSLContext.new("TLSv1")
-      ssl = OpenSSL::SSL::SSLSocket.new(sock, ctx)
-      ssl.sync_close = true
-      ssl.connect
-      session = ssl.session
-      assert(session == OpenSSL::SSL::Session.new(session.to_pem))
-      assert(session == OpenSSL::SSL::Session.new(ssl))
-      assert_equal(300, session.timeout)
-      session.timeout = 5
-      assert_equal(5, session.timeout)
-      assert_not_nil(session.time)
-      # SSL_SESSION_time keeps long value so we can't keep nsec fragment.
-      session.time = t1 = Time.now.to_i
-      assert_equal(Time.at(t1), session.time)
-      if session.respond_to?(:id)
-        assert_not_nil(session.id)
+      start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true) do |server, port|
+        sock = TCPSocket.new("127.0.0.1", port)
+        ctx = OpenSSL::SSL::SSLContext.new("TLSv1")
+        ssl = OpenSSL::SSL::SSLSocket.new(sock, ctx)
+        ssl.sync_close = true
+        ssl.connect
+        session = ssl.session
+        assert(session == OpenSSL::SSL::Session.new(session.to_pem))
+        assert(session == OpenSSL::SSL::Session.new(ssl))
+        assert_equal(300, session.timeout)
+        session.timeout = 5
+        assert_equal(5, session.timeout)
+        assert_not_nil(session.time)
+        # SSL_SESSION_time keeps long value so we can't keep nsec fragment.
+        session.time = t1 = Time.now.to_i
+        assert_equal(Time.at(t1), session.time)
+        if session.respond_to?(:id)
+          assert_not_nil(session.id)
+        end
+        pem = session.to_pem
+        assert_match(/\A-----BEGIN SSL SESSION PARAMETERS-----/, pem)
+        assert_match(/-----END SSL SESSION PARAMETERS-----\Z/, pem)
+        pem.gsub!(/-----(BEGIN|END) SSL SESSION PARAMETERS-----/, '').gsub!(/[\r\n]+/m, '')
+        assert_equal(session.to_der, pem.unpack('m*')[0])
+        assert_not_nil(session.to_text)
+        ssl.close
       end
-      pem = session.to_pem
-      assert_match(/\A-----BEGIN SSL SESSION PARAMETERS-----/, pem)
-      assert_match(/-----END SSL SESSION PARAMETERS-----\Z/, pem)
-      pem.gsub!(/-----(BEGIN|END) SSL SESSION PARAMETERS-----/, '').gsub!(/[\r\n]+/m, '')
-      assert_equal(session.to_der, pem.unpack('m*')[0])
-      assert_not_nil(session.to_text)
-      ssl.close
-    end
     end
   end
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]