[Groonga-commit] ranguba/gqtp at 07d96a5 [master] Use ArgumentError instead of RuntimeError

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Jan 7 15:21:31 JST 2014


Kouhei Sutou	2014-01-07 15:21:31 +0900 (Tue, 07 Jan 2014)

  New Revision: 07d96a55880e4d3ceba360ab71121aec8c618bb9
  https://github.com/ranguba/gqtp/commit/07d96a55880e4d3ceba360ab71121aec8c618bb9

  Message:
    Use ArgumentError instead of RuntimeError

  Modified files:
    lib/gqtp/client.rb
    test/test-client.rb

  Modified: lib/gqtp/client.rb (+1 -1)
===================================================================
--- lib/gqtp/client.rb    2013-12-26 12:19:29 +0900 (01e2db2)
+++ lib/gqtp/client.rb    2014-01-07 15:21:31 +0900 (05d8560)
@@ -108,7 +108,7 @@ module GQTP
       begin
         require "gqtp/connection/#{connection}"
       rescue LoadError
-        raise "unknown connection: <#{connection.inspect}>"
+        raise ArgumentError, "unknown connection: <#{connection.inspect}>"
       end
 
       module_name = connection.to_s.capitalize

  Modified: test/test-client.rb (+6 -0)
===================================================================
--- test/test-client.rb    2013-12-26 12:19:29 +0900 (b111df1)
+++ test/test-client.rb    2014-01-07 15:21:31 +0900 (3ad7493)
@@ -61,6 +61,12 @@ class ClientTest < Test::Unit::TestCase
     request.wait
   end
 
+  def test_unknown_connection
+    assert_raise(ArgumentError.new("unknown connection: <\"unknown\">")) do
+      GQTP::Client.new(:connection => "unknown")
+    end
+  end
+
   private
   def process_client(client)
     header = GQTP::Header.parse(client.read(GQTP::Header.size))
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index