Navigation Menu

Skip to content

Commit

Permalink
schema: Move Table#to_table_create_body test
Browse files Browse the repository at this point in the history
  • Loading branch information
darashi committed Feb 18, 2014
1 parent 5127f25 commit 9ab742d
Showing 1 changed file with 18 additions and 40 deletions.
58 changes: 18 additions & 40 deletions test/unit/catalog/test_schema.rb
Expand Up @@ -32,46 +32,6 @@ def test_no_table
create_schema({}).to_commands)
end

def test_hash_table
assert_equal([
"type" => "table_create",
"body" => {
"name" => "table_name",
"key_type" => "ShortText",
"flags" => "TABLE_HASH_KEY"
}
],
create_schema(
"table_name" => {
"type" => "Hash",
"keyType" => "ShortText"
}
).to_commands
)
end

def test_patricia_trie_table
assert_equal([
"type" => "table_create",
"body" => {
"name" => "table_name",
"key_type" => "ShortText",
"flags" => "TABLE_PAT_KEY",
"normalizer" => "NormalizerAuto",
"default_tokenizer" => "TokenBigram"
}
],
create_schema(
"table_name" => {
"type" => "PatriciaTrie",
"keyType" => "ShortText",
"normalizer" => "NormalizerAuto",
"tokenizer" => "TokenBigram"
}
).to_commands
)
end

=begin
def test_integration
assert_equal([
Expand Down Expand Up @@ -222,6 +182,24 @@ def test_normalizer
"normalizer" => "NormalizerAuto"
}).normalizer)
end

def test_to_table_create_body
assert_equal({
"name" => "table_name",
"key_type" => "ShortText",
"flags" => "TABLE_PAT_KEY",
"normalizer" => "NormalizerAuto",
"default_tokenizer" => "TokenBigram"
},
create_table("table_name",
{
"type" => "PatriciaTrie",
"keyType" => "ShortText",
"normalizer" => "NormalizerAuto",
"tokenizer" => "TokenBigram"
}).to_table_create_body)

end
end

class ColumnTest < self
Expand Down

0 comments on commit 9ab742d

Please sign in to comment.