aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_format.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-22 02:52:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-22 02:52:35 +0000
commitb551e8c8b36766651be4e782e09e3b02e7d14a10 (patch)
treee164a1ef908bd4451568abf05b688f1593915b81 /test/rubygems/test_gem_format.rb
parent65544f575b25b18dc27f9364f973556ddb48538f (diff)
downloadruby-b551e8c8b36766651be4e782e09e3b02e7d14a10.tar.gz
* lib/rubygems: update to 1.3.6.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_format.rb')
-rw-r--r--test/rubygems/test_gem_format.rb21
1 files changed, 12 insertions, 9 deletions
diff --git a/test/rubygems/test_gem_format.rb b/test/rubygems/test_gem_format.rb
index d9ddf0be92..555f98d77c 100644
--- a/test/rubygems/test_gem_format.rb
+++ b/test/rubygems/test_gem_format.rb
@@ -1,9 +1,3 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
require_relative 'gemutilities'
require_relative 'simple_gem'
require 'rubygems/format'
@@ -16,7 +10,7 @@ class TestGemFormat < RubyGemTestCase
@simple_gem = SIMPLE_GEM
end
- def test_from_file_by_path
+ def test_class_from_file_by_path
util_make_gems
gems = Dir[File.join(@gemhome, 'cache', '*.gem')]
@@ -34,13 +28,22 @@ class TestGemFormat < RubyGemTestCase
end
end
- def test_from_file_by_path_nonexistent
+ def test_class_from_file_by_path_empty
+ util_make_gems
+
+ empty_gem = File.join @tempdir, 'empty.gem'
+ FileUtils.touch empty_gem
+
+ assert_nil Gem::Format.from_file_by_path(empty_gem)
+ end
+
+ def test_class_from_file_by_path_nonexistent
assert_raises Gem::Exception do
Gem::Format.from_file_by_path '/nonexistent'
end
end
- def test_from_io_garbled
+ def test_class_from_io_garbled
e = assert_raises Gem::Package::FormatError do
# subtly bogus input
Gem::Format.from_io(StringIO.new(@simple_gem.upcase))