Kouhei Sutou
null+****@clear*****
Thu Apr 24 15:54:24 JST 2014
Kouhei Sutou 2014-04-24 15:54:24 +0900 (Thu, 24 Apr 2014) New Revision: 246170e49988a6660387e06e022857ebcb1960ea https://github.com/droonga/droonga-engine/commit/246170e49988a6660387e06e022857ebcb1960ea Message: Remove needless code `@context` isn't initialized. It is nil. Modified files: test/unit/plugins/groonga/test_column_create.rb test/unit/plugins/groonga/test_column_list.rb test/unit/plugins/groonga/test_column_remove.rb test/unit/plugins/groonga/test_column_rename.rb test/unit/plugins/groonga/test_delete.rb test/unit/plugins/groonga/test_table_list.rb test/unit/plugins/groonga/test_table_remove.rb Modified: test/unit/plugins/groonga/test_column_create.rb (+5 -5) =================================================================== --- test/unit/plugins/groonga/test_column_create.rb 2014-04-24 15:52:16 +0900 (c8e5831) +++ test/unit/plugins/groonga/test_column_create.rb 2014-04-24 15:54:24 +0900 (aecadfb) @@ -22,7 +22,7 @@ class ColumnCreateTest < GroongaHandlerTest end def test_success - Groonga::Schema.define(:context => @context) do |schema| + Groonga::Schema.define do |schema| schema.create_table("Books", :type => :hash) end message = { @@ -51,7 +51,7 @@ class ColumnCreateTest < GroongaHandlerTest 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, @@ -63,7 +63,7 @@ column_create Books title COLUMN_SCALAR ShortText 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, @@ -94,7 +94,7 @@ column_create Books main_text COLUMN_SCALAR LongText "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) @@ -108,7 +108,7 @@ column_create Books title #{data[:flags]} ShortText 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, Modified: test/unit/plugins/groonga/test_column_list.rb (+5 -5) =================================================================== --- test/unit/plugins/groonga/test_column_list.rb 2014-04-24 15:52:16 +0900 (7451f59) +++ test/unit/plugins/groonga/test_column_list.rb 2014-04-24 15:54:24 +0900 (fd6ca67) @@ -34,7 +34,7 @@ class ColumnListTest < GroongaHandlerTest 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) @@ -67,7 +67,7 @@ class ColumnListTest < GroongaHandlerTest 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) @@ -90,7 +90,7 @@ class ColumnListTest < GroongaHandlerTest 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) @@ -113,7 +113,7 @@ class ColumnListTest < GroongaHandlerTest 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) @@ -136,7 +136,7 @@ class ColumnListTest < GroongaHandlerTest 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) Modified: test/unit/plugins/groonga/test_column_remove.rb (+4 -4) =================================================================== --- test/unit/plugins/groonga/test_column_remove.rb 2014-04-24 15:52:16 +0900 (dc3b596) +++ test/unit/plugins/groonga/test_column_remove.rb 2014-04-24 15:54:24 +0900 (97698a9) @@ -22,7 +22,7 @@ class ColumnRemoveTest < GroongaHandlerTest 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) @@ -53,7 +53,7 @@ class ColumnRemoveTest < GroongaHandlerTest 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 = { @@ -68,7 +68,7 @@ class ColumnRemoveTest < GroongaHandlerTest 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) @@ -82,7 +82,7 @@ table_create Books TABLE_HASH_KEY --key_type ShortText 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) Modified: test/unit/plugins/groonga/test_column_rename.rb (+4 -4) =================================================================== --- test/unit/plugins/groonga/test_column_rename.rb 2014-04-24 15:52:16 +0900 (afb18f8) +++ test/unit/plugins/groonga/test_column_rename.rb 2014-04-24 15:54:24 +0900 (d727c19) @@ -22,7 +22,7 @@ class ColumnRenameTest < GroongaHandlerTest 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) @@ -55,7 +55,7 @@ class ColumnRenameTest < GroongaHandlerTest 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 = { @@ -71,7 +71,7 @@ class ColumnRenameTest < GroongaHandlerTest 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) @@ -86,7 +86,7 @@ column_create Books label COLUMN_SCALAR ShortText 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) Modified: test/unit/plugins/groonga/test_delete.rb (+6 -6) =================================================================== --- test/unit/plugins/groonga/test_delete.rb 2014-04-24 15:52:16 +0900 (92ad296) +++ test/unit/plugins/groonga/test_delete.rb 2014-04-24 15:54:24 +0900 (7e1d60f) @@ -22,7 +22,7 @@ class DeleteTest < GroongaHandlerTest 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") @@ -49,7 +49,7 @@ class DeleteTest < GroongaHandlerTest 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 = { @@ -66,7 +66,7 @@ class DeleteTest < GroongaHandlerTest :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 = { @@ -81,7 +81,7 @@ class DeleteTest < GroongaHandlerTest 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") @@ -93,7 +93,7 @@ table_create Books TABLE_HASH_KEY --key_type ShortText 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([]) @@ -105,7 +105,7 @@ table_create Ages TABLE_NO_KEY 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"] Modified: test/unit/plugins/groonga/test_table_list.rb (+8 -8) =================================================================== --- test/unit/plugins/groonga/test_table_list.rb 2014-04-24 15:52:16 +0900 (913e817) +++ test/unit/plugins/groonga/test_table_list.rb 2014-04-24 15:54:24 +0900 (2bd85fa) @@ -33,7 +33,7 @@ class TableListTest < GroongaHandlerTest 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, {}) @@ -45,7 +45,7 @@ class TableListTest < GroongaHandlerTest 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, {}) @@ -64,7 +64,7 @@ class TableListTest < GroongaHandlerTest 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, {}) @@ -83,7 +83,7 @@ class TableListTest < GroongaHandlerTest 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, {}) @@ -102,7 +102,7 @@ class TableListTest < GroongaHandlerTest 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, {}) @@ -121,7 +121,7 @@ class TableListTest < GroongaHandlerTest 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") @@ -142,7 +142,7 @@ class TableListTest < GroongaHandlerTest 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 @@ -162,7 +162,7 @@ class TableListTest < GroongaHandlerTest 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 Modified: test/unit/plugins/groonga/test_table_remove.rb (+1 -1) =================================================================== --- test/unit/plugins/groonga/test_table_remove.rb 2014-04-24 15:52:16 +0900 (f5fd1b1) +++ test/unit/plugins/groonga/test_table_remove.rb 2014-04-24 15:54:24 +0900 (a7b6a7b) @@ -23,7 +23,7 @@ class TableRemoveTest < GroongaHandlerTest def setup super - Groonga::Schema.define(:context => @context) do |schema| + Groonga::Schema.define do |schema| schema.create_table("Books", :type => :hash) end end -------------- next part -------------- HTML����������������������������...Download