Kouhei Sutou
null+****@clear*****
Wed Dec 13 11:43:24 JST 2017
Kouhei Sutou 2017-12-13 11:43:24 +0900 (Wed, 13 Dec 2017) New Revision: 787fad578a5ef125def1f34a26f86c778623eef3 https://github.com/ranguba/chupa-text/commit/787fad578a5ef125def1f34a26f86c778623eef3 Message: test: compatible with Ruby 2.5 URI("file:///...").to_s is "file:///..." in 2.5, "file:/..." before 2.5. Modified files: test/decomposers/test-tar.rb test/decomposers/test-zip.rb test/helper.rb Modified: test/decomposers/test-tar.rb (+2 -2) =================================================================== --- test/decomposers/test-tar.rb 2017-12-13 11:30:09 +0900 (480b194) +++ test/decomposers/test-tar.rb 2017-12-13 11:43:24 +0900 (503bc65) @@ -46,7 +46,7 @@ class TestDecomposersTar < Test::Unit::TestCase data = ChupaText::InputData.new(data_path) assert_equal([ { - :uri => "file:#{base_path}/top-level.txt", + :uri => file_uri("#{base_path}/top-level.txt").to_s, :body => "top level\n", :source => data.uri.to_s, }, @@ -62,7 +62,7 @@ class TestDecomposersTar < Test::Unit::TestCase data = ChupaText::InputData.new(data_path) assert_equal([ { - :uri => "file:#{base_path}/directory/hello.txt", + :uri => file_uri("#{base_path}/directory/hello.txt").to_s, :body => "Hello in directory\n", :source => data.uri.to_s, }, Modified: test/decomposers/test-zip.rb (+6 -6) =================================================================== --- test/decomposers/test-zip.rb 2017-12-13 11:30:09 +0900 (b9510c4) +++ test/decomposers/test-zip.rb 2017-12-13 11:43:24 +0900 (235836a) @@ -45,19 +45,19 @@ class TestDecomposersZip < Test::Unit::TestCase base_path = data_path.sub_ext("") assert_equal([ { - :uri => "file:#{base_path}/hello.txt", + :uri => file_uri("#{base_path}/hello.txt").to_s, :body => "Hello!\n", - :source => "file:#{data_path}", + :source => file_uri(data_path).to_s, }, { - :uri => "file:#{base_path}/hello.csv", + :uri => file_uri("#{base_path}/hello.csv").to_s, :body => "Hello,World\n", - :source => "file:#{data_path}", + :source => file_uri(data_path).to_s, }, { - :uri => "file:#{base_path}/hello/world.txt", + :uri => file_uri("#{base_path}/hello/world.txt").to_s, :body => "World!\n", - :source => "file:#{data_path}", + :source => file_uri(data_path).to_s, }, ], decompose(data_path)) Modified: test/helper.rb (+4 -0) =================================================================== --- test/helper.rb 2017-12-13 11:30:09 +0900 (659c7c4) +++ test/helper.rb 2017-12-13 11:43:24 +0900 (ff41c41) @@ -26,6 +26,10 @@ module Helper def fixture_uri(*components) path = fixture_path(*components) + file_uri(path) + end + + def file_uri(path) URI.parse("file://#{path}") end end -------------- next part -------------- HTML����������������������������... URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20171213/27f634b9/attachment-0001.htm