diff options
author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-28 12:33:44 +0000 |
---|---|---|
committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-28 12:33:44 +0000 |
commit | bac3ea1fca1ed30098e74dd7296836aee413c31a (patch) | |
tree | 0868dcda3aee0ce58b46ac83dec75f36f41790f3 /test/rss/rss-assertions.rb | |
parent | a73ba1def712921b5ab6d13dd8055cbb687c4641 (diff) |
* test/rss/: use PNG instead of zlib as binary data.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rss/rss-assertions.rb')
-rw-r--r-- | test/rss/rss-assertions.rb | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/test/rss/rss-assertions.rb b/test/rss/rss-assertions.rb index f396e9a446..12e53f7cd5 100644 --- a/test/rss/rss-assertions.rb +++ b/test/rss/rss-assertions.rb @@ -557,20 +557,16 @@ EOA 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! + png_file = File.join(File.dirname(__FILE__), "dot.png") + png = File.open(png_file, "rb") do |file| + file.read.force_encoding("binary") end - base64_content = [Zlib::Deflate.deflate(text)].pack("m").delete("\n") + base64_content = [png].pack("m").delete("\n") [false, true].each do |with_space| xml_content = base64_content @@ -591,7 +587,7 @@ EOA 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) |