Kouhei Sutou
null+****@clear*****
Thu Jan 30 17:23:21 JST 2014
Kouhei Sutou 2014-01-30 17:23:21 +0900 (Thu, 30 Jan 2014) New Revision: 1a10816fd5e65a3183603a8eb50219a14d365828 https://github.com/droonga/fluent-plugin-droonga/commit/1a10816fd5e65a3183603a8eb50219a14d365828 Message: test: add shortcut method Modified files: test/unit/catalog/test_version1.rb Modified: test/unit/catalog/test_version1.rb (+7 -4) =================================================================== --- test/unit/catalog/test_version1.rb 2014-01-30 17:07:15 +0900 (30fcf20) +++ test/unit/catalog/test_version1.rb 2014-01-30 17:23:21 +0900 (3a5820d) @@ -1,4 +1,4 @@ -# Copyright (C) 2013 Droonga Project +# Copyright (C) 2013-2014 Droonga Project # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -18,7 +18,7 @@ require "droonga/catalog/version1" class CatalogTest < Test::Unit::TestCase def setup data = JSON.parse(File.read(catalog_path)) - @catalog = Droonga::Catalog::Version1.new(data, base_path) + @catalog = create_catalog(data, base_path) end def test_option @@ -53,6 +53,10 @@ class CatalogTest < Test::Unit::TestCase end private + def create_catalog(data, base_path) + Droonga::Catalog::Version1.new(data, base_path) + end + def fixture_path(base_path) File.expand_path("../../fixtures/#{base_path}", __FILE__) end @@ -91,8 +95,7 @@ class CatalogTest < Test::Unit::TestCase private def total_weight(dataset) - catalog = Droonga::Catalog::Version1.new({"datasets" => []}, - "base-path") + catalog = create_catalog({"datasets" => []}, "base-path") catalog.send(:compute_total_weight, dataset) end end -------------- next part -------------- HTML����������������������������...Download