YUKI Hiroshi
null+****@clear*****
Wed May 29 14:46:45 JST 2013
YUKI Hiroshi 2013-05-29 14:46:45 +0900 (Wed, 29 May 2013) New Revision: c5190f8cd5e4e356c4eef54dd9303d522938a908 https://github.com/groonga/fluent-plugin-droonga/commit/c5190f8cd5e4e356c4eef54dd9303d522938a908 Message: Add test for static values Modified files: test/plugin/test_handler_search.rb Modified: test/plugin/test_handler_search.rb (+54 -0) =================================================================== --- test/plugin/test_handler_search.rb 2013-05-29 14:14:42 +0900 (8fcc049) +++ test/plugin/test_handler_search.rb 2013-05-29 14:46:45 +0900 (9df6316) @@ -298,6 +298,60 @@ class SearchHandlerTest < Test::Unit::TestCase } assert_search(expected, request) end + + def test_static_value + expected = { + "sections-result" => { + "records" => [ + { + "single_quote_string" => "string value", + "double_quote_string" => "string value", + "integer" => 29, + "complex_negative_number" => -29.29, + }, + { + "single_quote_string" => "string value", + "double_quote_string" => "string value", + "integer" => 29, + "complex_negative_number" => -29.29, + }, + ], + }, + } + request = { + "queries" => { + "sections-result" => { + "source" => "Sections", + "output" => { + "elements" => [ + "records", + ], + "format" => "complex", + "limit" => 2, + "attributes" => [ + { + "label" => "single_quote_string", + "source" => "'string value'", + }, + { + "label" => "double_quote_string", + "source" => '"string value"', + }, + { + "label" => "integer", + "source" => "29", + }, + { + "label" => "complex_negative_number", + "source" => "-29.29", + }, + ], + }, + }, + }, + } + assert_search(expected, request) + end end class FormatTest < self -------------- next part -------------- HTML����������������������������... ダウンロード