diff options
author | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-01 03:11:34 +0000 |
---|---|---|
committer | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-01 03:11:34 +0000 |
commit | ec84bfc9e3d11a3b1dbebcaf4d1ddf1357307513 (patch) | |
tree | cc3b9df7f06f86c52f4d09c03f5c9a3876c87b67 /test/rubygems/test_gem_package_tar_input.rb | |
parent | f4234c9b8f4707c5979d9a3beddc19ceeb417bd8 (diff) | |
download | ruby-ec84bfc9e3d11a3b1dbebcaf4d1ddf1357307513.tar.gz |
Import rubygems 1.5.0 (released version @ 1fb59d0)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_package_tar_input.rb')
-rw-r--r-- | test/rubygems/test_gem_package_tar_input.rb | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/test/rubygems/test_gem_package_tar_input.rb b/test/rubygems/test_gem_package_tar_input.rb index 0d3de45ba4..72c1ce194a 100644 --- a/test/rubygems/test_gem_package_tar_input.rb +++ b/test/rubygems/test_gem_package_tar_input.rb @@ -59,7 +59,24 @@ class TestGemPackageTarInput < Gem::Package::TarTestCase @entry_contents = %w[0123456789 01234] end - def test_each_works + def test_initialize_no_metadata_file + Tempfile.open 'no_meta' do |io| + io.write tar_file_header('a', '', 0644, 1) + io.write 'a' + io.rewind + + e = assert_raises Gem::Package::FormatError do + open io.path, Gem.binary_mode do |file| + Gem::Package::TarInput.open file do end + end + end + + assert_equal "no metadata found in #{io.path}", e.message + assert_equal io.path, e.path + end + end + + def test_each open @file, 'rb' do |io| Gem::Package::TarInput.open io do |tar_input| count = 0 @@ -79,7 +96,7 @@ class TestGemPackageTarInput < Gem::Package::TarTestCase end end - def test_extract_entry_works + def test_extract_entry open @file, 'rb' do |io| Gem::Package::TarInput.open io do |tar_input| assert_equal @spec, tar_input.metadata |