Navigation Menu

Skip to content

Commit

Permalink
Remove needless code
Browse files Browse the repository at this point in the history
`@context` isn't initialized. It is nil.
  • Loading branch information
kou committed Apr 24, 2014
1 parent 9c79fbf commit 246170e
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 33 deletions.
10 changes: 5 additions & 5 deletions test/unit/plugins/groonga/test_column_create.rb
Expand Up @@ -22,7 +22,7 @@ def create_handler
end

def test_success
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
end
message = {
Expand Down Expand Up @@ -51,7 +51,7 @@ def test_unknown_table
end

def test_name
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
end
process(:column_create,
Expand All @@ -63,7 +63,7 @@ def test_name
end

def test_type
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
end
process(:column_create,
Expand Down Expand Up @@ -94,7 +94,7 @@ def test_data_store_column_type(data)
"type" => "ShortText",
"flags" => data[:flags],
}
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
end
process(:column_create, request)
Expand All @@ -108,7 +108,7 @@ def test_data_store_column_type(data)
class IndexTest < self
def setup
super
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
end
process(:column_create,
Expand Down
10 changes: 5 additions & 5 deletions test/unit/plugins/groonga/test_column_list.rb
Expand Up @@ -34,7 +34,7 @@ def create_handler

class HeaderTest < self
def test_success
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
schema.change_table("Books") do |table|
table.column("title", "ShortText", :type => :scalar)
Expand Down Expand Up @@ -67,7 +67,7 @@ def test_unknown_table

class BodyTest < self
def test_fix
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
schema.change_table("Books") do |table|
table.column("age", "UInt32", :type => :scalar)
Expand All @@ -90,7 +90,7 @@ def test_fix
end

def test_var
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
schema.change_table("Books") do |table|
table.column("title", "ShortText", :type => :scalar)
Expand All @@ -113,7 +113,7 @@ def test_var
end

def test_vector
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
schema.change_table("Books") do |table|
table.column("authors", "ShortText", :type => :vector)
Expand All @@ -136,7 +136,7 @@ def test_vector
end

def test_index
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
schema.change_table("Books") do |table|
table.column("title", "ShortText", :type => :scalar)
Expand Down
8 changes: 4 additions & 4 deletions test/unit/plugins/groonga/test_column_remove.rb
Expand Up @@ -22,7 +22,7 @@ def create_handler
end

def test_success
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
schema.change_table("Books") do |table|
table.column("title", "ShortText", :type => :scalar)
Expand Down Expand Up @@ -53,7 +53,7 @@ def test_unknown_table
end

def test_unknown_column
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
end
message = {
Expand All @@ -68,7 +68,7 @@ def test_unknown_column
end

def test_remove
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
schema.change_table("Books") do |table|
table.column("title", "ShortText", :type => :scalar)
Expand All @@ -82,7 +82,7 @@ def test_remove
end

def test_remove_index
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
schema.change_table("Books") do |table|
table.column("title", "ShortText", :type => :scalar)
Expand Down
8 changes: 4 additions & 4 deletions test/unit/plugins/groonga/test_column_rename.rb
Expand Up @@ -22,7 +22,7 @@ def create_handler
end

def test_success
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
schema.change_table("Books") do |table|
table.column("title", "ShortText", :type => :scalar)
Expand Down Expand Up @@ -55,7 +55,7 @@ def test_unknown_table
end

def test_unknown_column
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
end
message = {
Expand All @@ -71,7 +71,7 @@ def test_unknown_column
end

def test_rename
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
schema.change_table("Books") do |table|
table.column("title", "ShortText", :type => :scalar)
Expand All @@ -86,7 +86,7 @@ def test_rename
end

def test_rename_with_index
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
schema.change_table("Books") do |table|
table.column("title", "ShortText", :type => :scalar)
Expand Down
12 changes: 6 additions & 6 deletions test/unit/plugins/groonga/test_delete.rb
Expand Up @@ -22,7 +22,7 @@ def create_handler
end

def test_success
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
end
Groonga::Context.default["Books"].add("sample")
Expand All @@ -49,7 +49,7 @@ def test_unknown_table
end

def test_no_identifier
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
end
message = {
Expand All @@ -66,7 +66,7 @@ def test_no_identifier
:id_and_filter => { "id" => "1", "filter" => "filter" },
:key_and_filter => { "key" => "key", "filter" => "filter" })
def test_duplicated_identifier(data)
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
end
message = {
Expand All @@ -81,7 +81,7 @@ def test_duplicated_identifier(data)

class DeleteTest < self
def test_key
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
end
Groonga::Context.default["Books"].add("sample")
Expand All @@ -93,7 +93,7 @@ def test_key
end

def test_id
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Ages", :type => :array)
end
Groonga::Context.default["Ages"].add([])
Expand All @@ -105,7 +105,7 @@ def test_id
end

def test_filter
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
end
table = Groonga::Context.default["Books"]
Expand Down
16 changes: 8 additions & 8 deletions test/unit/plugins/groonga/test_table_list.rb
Expand Up @@ -33,7 +33,7 @@ def create_handler
end

def test_success
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
end
response = process(:column_list, {})
Expand All @@ -45,7 +45,7 @@ def test_success

class ListTest < self
def test_hash_table
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
end
response = process(:table_list, {})
Expand All @@ -64,7 +64,7 @@ def test_hash_table
end

def test_array_table
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("HistoryEntries", :type => :array)
end
response = process(:table_list, {})
Expand All @@ -83,7 +83,7 @@ def test_array_table
end

def test_patricia_trie_table
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :patricia_trie)
end
response = process(:table_list, {})
Expand All @@ -102,7 +102,7 @@ def test_patricia_trie_table
end

def test_double_array_trie_table
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :double_array_trie)
end
response = process(:table_list, {})
Expand All @@ -121,7 +121,7 @@ def test_double_array_trie_table
end

def test_with_value_type
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("BookIds", :type => :hash,
:key_type => "UInt32",
:value_type => "UInt32")
Expand All @@ -142,7 +142,7 @@ def test_with_value_type
end

def test_with_default_tokenizer
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash,
:default_tokenizer => "TokenBigram")
end
Expand All @@ -162,7 +162,7 @@ def test_with_default_tokenizer
end

def test_with_normalizer
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash,
:normalizer => "NormalizerAuto")
end
Expand Down
2 changes: 1 addition & 1 deletion test/unit/plugins/groonga/test_table_remove.rb
Expand Up @@ -23,7 +23,7 @@ def create_handler

def setup
super
Groonga::Schema.define(:context => @context) do |schema|
Groonga::Schema.define do |schema|
schema.create_table("Books", :type => :hash)
end
end
Expand Down

0 comments on commit 246170e

Please sign in to comment.