diff options
| author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-28 11:48:17 +0000 |
|---|---|---|
| committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-28 11:48:17 +0000 |
| commit | 678e27be1b1779442b8fb10d702a517adc74afce (patch) | |
| tree | 24582d03dbd11b111ec06ba8d8c1c9f909a62862 /test | |
| parent | bfc32f3e6ce32bc35ca2d581ba06b8a3fb6cf474 (diff) | |
* test/rss/: use PNG instead of zlib as binary data. [ruby-dev:35666]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@18246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
| -rw-r--r-- | test/rss/dot.png | bin | 0 -> 111 bytes | |||
| -rw-r--r-- | test/rss/rss-assertions.rb | 16 | ||||
| -rw-r--r-- | test/rss/test_atom.rb | 17 |
3 files changed, 10 insertions, 23 deletions
diff --git a/test/rss/dot.png b/test/rss/dot.png Binary files differnew file mode 100644 index 0000000000..9c6960fa2f --- /dev/null +++ b/test/rss/dot.png diff --git a/test/rss/rss-assertions.rb b/test/rss/rss-assertions.rb index f396e9a446..b9fe47e47a 100644 --- a/test/rss/rss-assertions.rb +++ b/test/rss/rss-assertions.rb @@ -557,20 +557,14 @@ 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! - 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 @@ 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) diff --git a/test/rss/test_atom.rb b/test/rss/test_atom.rb index 1f65008fa0..d573b923cc 100644 --- a/test/rss/test_atom.rb +++ b/test/rss/test_atom.rb @@ -641,24 +641,17 @@ module RSS def assert_atom_content_inline_other_base64_to_s(target_class) _wrap_assertion do - require "zlib" - - text = "" - char = "a" - 100.times do |i| - text << char - char.succ! - end - - type = "application/zip" - original_content = Zlib::Deflate.deflate(text) + type = "image/png" + png_file = File.join(File.dirname(__FILE__), "dot.png") + original_content = File.open(png_file, "rb") {|file| file.read} 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 |
