[Groonga-commit] groonga/grntest [master] translate_url -> to_url

Back to archive index

null+****@clear***** null+****@clear*****
2012年 6月 6日 (水) 13:32:44 JST


Haruka Yoshihara	2012-06-06 13:32:44 +0900 (Wed, 06 Jun 2012)

  New Revision: 7324a50af34de955cc70c6b5245d40e9908260b3

  Log:
    translate_url -> to_url

  Modified files:
    lib/groonga/tester.rb
    test/test-executor.rb

  Modified: lib/groonga/tester.rb (+6 -2)
===================================================================
--- lib/groonga/tester.rb    2012-06-06 13:28:51 +0900 (71bc134)
+++ lib/groonga/tester.rb    2012-06-06 13:32:44 +0900 (16ea964)
@@ -616,8 +616,12 @@ module Groonga
     end
 
     class CommandFormatConverter
-      def translate_url(line)
-        line = line.chomp
+      def initialize(gqtp_command)
+        @gqtp_command = gqtp_command
+      end
+
+      def to_url
+        line = @gqtp_command.chomp
         return "" if line.empty?
 
         line = line.gsub(/"/, "\\\\\"")

  Modified: test/test-executor.rb (+2 -5)
===================================================================
--- test/test-executor.rb    2012-06-06 13:28:51 +0900 (7aa3093)
+++ test/test-executor.rb    2012-06-06 13:32:44 +0900 (cec1681)
@@ -54,10 +54,6 @@ class TestExecutor < Test::Unit::TestCase
   end
 
   class TestTranslate < self
-    def setup
-      @converter = Groonga::Tester::CommandFormatConverter.new
-    end
-
     def test_command
       command = "table_create Site TABLE_HASH_KEY ShortText"
       arguments = {
@@ -142,7 +138,8 @@ EOF
 
     private
     def translate(command)
-      @converter.translate_url(command)
+      converter = Groonga::Tester::CommandFormatConverter.new(command)
+      converter.to_url
     end
 
     def build_url(command, arguments)




Groonga-commit メーリングリストの案内
Back to archive index