aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_package_tar_output.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-29 06:52:18 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-29 06:52:18 +0000
commit9694bb8cac12969300692dac5a1cf7aa4e3a46cd (patch)
treec3cb423d701f7049ba9382de052e2a937cd1302d /test/rubygems/test_gem_package_tar_output.rb
parent3f606b7063fc7a8b191556365ad343a314719a8d (diff)
downloadruby-9694bb8cac12969300692dac5a1cf7aa4e3a46cd.tar.gz
* lib/rubygems*: Updated to RubyGems 2.0
* test/rubygems*: ditto. * common.mk (prelude): Updated for RubyGems 2.0 source rearrangement. * tool/change_maker.rb: Allow invalid UTF-8 characters in source files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_package_tar_output.rb')
-rw-r--r--test/rubygems/test_gem_package_tar_output.rb101
1 files changed, 0 insertions, 101 deletions
diff --git a/test/rubygems/test_gem_package_tar_output.rb b/test/rubygems/test_gem_package_tar_output.rb
deleted file mode 100644
index ecf25ef107..0000000000
--- a/test/rubygems/test_gem_package_tar_output.rb
+++ /dev/null
@@ -1,101 +0,0 @@
-require 'rubygems/package/tar_test_case'
-require 'rubygems/package/tar_output'
-require 'rubygems/security'
-
-class TestGemPackageTarOutput < Gem::Package::TarTestCase
-
- def setup
- super
-
- @file = File.join @tempdir, 'bla2.tar'
- end
-
- def test_self_open
- open @file, 'wb' do |tar_io|
- Gem::Package::TarOutput.open tar_io do |tar_writer|
- tar_writer.add_file_simple 'README', 0, 17 do |io|
- io.write "This is a README\n"
- end
-
- tar_writer.metadata = "This is some metadata\n"
- end
- end
-
- files = util_extract
-
- name, data = files.shift
- assert_equal 'data.tar.gz', name
-
- gz = Zlib::GzipReader.new StringIO.new(data)
-
- Gem::Package::TarReader.new gz do |tar_reader|
- tar_reader.each do |entry|
- assert_equal 'README', entry.full_name
- assert_equal "This is a README\n", entry.read
- end
- end
-
- gz.close
-
- name, data = files.shift
- assert_equal 'metadata.gz', name
-
- gz = Zlib::GzipReader.new StringIO.new(data)
- assert_equal "This is some metadata\n", gz.read
-
- assert_empty files
- ensure
- gz.close if gz
- end
-
- if defined? OpenSSL then
- def test_self_open_signed
- @private_key = File.expand_path('test/rubygems/private_key.pem', @@project_dir)
- @public_cert = File.expand_path('test/rubygems/public_cert.pem', @@project_dir)
-
- signer = Gem::Security::Signer.new @private_key, [@public_cert]
-
- open @file, 'wb' do |tar_io|
- Gem::Package::TarOutput.open tar_io, signer do |tar_writer|
- tar_writer.add_file_simple 'README', 0, 17 do |io|
- io.write "This is a README\n"
- end
-
- tar_writer.metadata = "This is some metadata\n"
- end
- end
-
- files = util_extract
-
- name, data = files.shift
- assert_equal 'data.tar.gz', name
-
- name, data = files.shift
- assert_equal 'metadata.gz', name
-
- name, data = files.shift
- assert_equal 'data.tar.gz.sig', name
-
- name, data = files.shift
- assert_equal 'metadata.gz.sig', name
-
- assert_empty files
- end
- end
-
- def util_extract
- files = []
-
- open @file, 'rb' do |io|
- Gem::Package::TarReader.new io do |tar_reader|
- tar_reader.each do |entry|
- files << [entry.full_name, entry.read]
- end
- end
- end
-
- files
- end
-
-end
-