Navigation Menu

Skip to content

Commit

Permalink
Fix argument
Browse files Browse the repository at this point in the history
normalize_..._body! should receive body object because the method name
says it normalizes "body".
  • Loading branch information
kou committed Apr 24, 2014
1 parent 97cf2fe commit c5f2e52
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/drntest/response-normalizer.rb
Expand Up @@ -103,14 +103,15 @@ def normalize_groonga_command_body!(body)

case @request["type"]
when "table_list"
normalize_groonga_table_list_command_body!(body[0][1..-1])
normalize_groonga_table_list_command_body!(body)
when "column_list"
normalize_groonga_column_list_command_body!(body[0][1..-1])
normalize_groonga_column_list_command_body!(body)
end
end

TABLE_PATH_COLUMN_INDEX = 2
def normalize_groonga_table_list_command_body!(tables)
def normalize_groonga_table_list_command_body!(body)
tables = body[0][1..-1]
return unless tables.is_a?(Array)
tables.each do |table|
if table[TABLE_PATH_COLUMN_INDEX].is_a?(String)
Expand All @@ -120,7 +121,8 @@ def normalize_groonga_table_list_command_body!(tables)
end

COLUMN_PATH_COLUMN_INDEX = 2
def normalize_groonga_column_list_command_body!(columns)
def normalize_groonga_column_list_command_body!(body)
columns = body[0][1..-1]
return unless columns.is_a?(Array)
columns.each do |column|
if column[COLUMN_PATH_COLUMN_INDEX].is_a?(String)
Expand Down

0 comments on commit c5f2e52

Please sign in to comment.