Navigation Menu

Skip to content

Commit

Permalink
test: use more meaningful assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 25, 2017
1 parent c481255 commit cafa443
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions test/response/test-column-list.rb
Expand Up @@ -20,7 +20,15 @@
class TestResponseColumnList < Test::Unit::TestCase
include TestResponseHelper

def test_column_list
def column(attributes)
c = Groonga::Client::Response::ColumnList::Column.new
attributes.each do |name, value|
c[name] = value
end
c
end

def test_parse
header = [0, 1372430096.70991, 0.000522851943969727]
body = [
[
Expand All @@ -47,7 +55,17 @@ def test_column_list
raw_response = [header, body].to_json

response = parse_raw_response("column_list", raw_response)
assert_equal(Groonga::Client::Response::ColumnList, response.class)
assert_equal([
column(:id => 256,
:name => "Text",
:path => "/tmp/test.db.0000100",
:type => "var",
:flags => "COLUMN_SCALAR|PERSISTENT",
:domain => "TestTable",
:range => "ShortText",
:source => []),
],
response.to_a)
end
end

0 comments on commit cafa443

Please sign in to comment.