ruby-changes:6730
From: kou <ko1@a...>
Date: Mon, 28 Jul 2008 20:48:31 +0900 (JST)
Subject: [ruby-changes:6730] Ruby:r18246 (ruby_1_8): * test/rss/: use PNG instead of zlib as binary data.
kou 2008-07-28 20:48:17 +0900 (Mon, 28 Jul 2008) New Revision: 18246 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18246 Log: * test/rss/: use PNG instead of zlib as binary data. [ruby-dev:35666] Added files: branches/ruby_1_8/test/rss/dot.png Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/test/rss/rss-assertions.rb branches/ruby_1_8/test/rss/test_atom.rb Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 18245) +++ ruby_1_8/ChangeLog (revision 18246) @@ -1,3 +1,7 @@ +Mon Jul 28 20:46:39 2008 Kouhei Sutou <kou@c...> + + * test/rss/: use PNG instead of zlib as binary data. [ruby-dev:35666] + Mon Jul 28 18:15:45 2008 Nobuyoshi Nakada <nobu@r...> * file.c (rb_find_file_ext, rb_find_file): not to split load path with Index: ruby_1_8/test/rss/rss-assertions.rb =================================================================== --- ruby_1_8/test/rss/rss-assertions.rb (revision 18245) +++ ruby_1_8/test/rss/rss-assertions.rb (revision 18246) @@ -557,20 +557,14 @@ def assert_atom_content_inline_other_text(generator) _wrap_assertion do - require "zlib" - - type = "application/zip" + type = "image/png" assert_parse(generator.call(<<-EOA), :nothing_raised) <content type="#{type}"/> EOA - text = "" - char = "a" - 100.times do |i| - text << char - char.succ! - end - base64_content = [Zlib::Deflate.deflate(text)].pack("m").delete("\n") + png_file = File.join(File.dirname(__FILE__), "dot.png") + png = File.open(png_file, "rb") {|file| file.read} + base64_content = [png].pack("m").delete("\n") [false, true].each do |with_space| xml_content = base64_content @@ -591,7 +585,7 @@ assert(content.inline_other_base64?) assert(!content.out_of_line?) assert(!content.have_xml_content?) - assert_equal(text, Zlib::Inflate.inflate(content.content)) + assert_equal(png, content.content) xml = REXML::Document.new(content.to_s).root assert_rexml_element([], {"type" => type}, base64_content, xml) Index: ruby_1_8/test/rss/dot.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = image/png Property changes on: ruby_1_8/test/rss/dot.png ___________________________________________________________________ Name: svn:mime-type + image/png Index: ruby_1_8/test/rss/test_atom.rb =================================================================== --- ruby_1_8/test/rss/test_atom.rb (revision 18245) +++ ruby_1_8/test/rss/test_atom.rb (revision 18246) @@ -641,24 +641,17 @@ def assert_atom_content_inline_other_base64_to_s(target_class) _wrap_assertion do - require "zlib" + type = "image/png" + png_file = File.join(File.dirname(__FILE__), "dot.png") + original_content = File.open(png_file, "rb") {|file| file.read} - text = "" - char = "a" - 100.times do |i| - text << char - char.succ! - end - - type = "application/zip" - original_content = Zlib::Deflate.deflate(text) - content = target_class.new content.type = type content.content = original_content xml = REXML::Document.new(content.to_s).root assert_rexml_element([], {"type" => type}, - [original_content].pack("m").delete("\n"), xml) + [original_content].pack("m").delete("\n"), + xml) end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/