aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_specification.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-22 08:24:42 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-22 08:24:42 +0000
commit372dcece3f69989d133f720468f1e24aa1133cda (patch)
treec173ca48a23ce18afa44feb15bf68d2dd14ac619 /test/rubygems/test_gem_specification.rb
parentd0e5a34ac7c34e70c145024a0fed8f6042814f29 (diff)
downloadruby-372dcece3f69989d133f720468f1e24aa1133cda.tar.gz
Update to RubyGems 1.3.7.pre.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_specification.rb')
-rw-r--r--test/rubygems/test_gem_specification.rb51
1 files changed, 45 insertions, 6 deletions
diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb
index 5979890aeb..97e2615fe2 100644
--- a/test/rubygems/test_gem_specification.rb
+++ b/test/rubygems/test_gem_specification.rb
@@ -473,6 +473,31 @@ end
assert_equal expected, @a1.files.sort
end
+ def test_files_append
+ @a1.files = %w(files bin/common)
+ @a1.test_files = %w(test_files bin/common)
+ @a1.executables = %w(executables common)
+ @a1.extra_rdoc_files = %w(extra_rdoc_files bin/common)
+ @a1.extensions = %w(extensions bin/common)
+
+ expected = %w[
+ bin/common
+ bin/executables
+ extensions
+ extra_rdoc_files
+ files
+ test_files
+ ]
+ assert_equal expected, @a1.files.sort
+
+ @a1.files << "generated_file.c"
+
+ expected << "generated_file.c"
+ expected.sort!
+
+ assert_equal expected, @a1.files.sort
+ end
+
def test_files_duplicate
@a2.files = %w[a b c d b]
@a2.extra_rdoc_files = %w[x y z x]
@@ -748,14 +773,14 @@ Gem::Specification.new do |s|
s.files = [\"lib/code.rb\"]
s.homepage = %q{http://example.com}
s.require_paths = [\"lib\"]
- s.rubygems_version = %q{#{Gem::RubyGemsVersion}}
+ s.rubygems_version = %q{#{Gem::VERSION}}
s.summary = %q{this is a summary}
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = #{Gem::Specification::CURRENT_SPECIFICATION_VERSION}
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<b>, [\"= 1\"])
else
s.add_dependency(%q<b>, [\"= 1\"])
@@ -802,7 +827,7 @@ Gem::Specification.new do |s|
s.require_paths = [\"lib\"]
s.requirements = [\"A working computer\"]
s.rubyforge_project = %q{example}
- s.rubygems_version = %q{#{Gem::RubyGemsVersion}}
+ s.rubygems_version = %q{#{Gem::VERSION}}
s.summary = %q{this is a summary}
s.test_files = [\"test/suite.rb\"]
@@ -810,7 +835,7 @@ Gem::Specification.new do |s|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<rake>, [\"> 0.4\"])
s.add_runtime_dependency(%q<jabber4r>, [\"> 0.0.0\"])
s.add_runtime_dependency(%q<pqa>, [\"> 0.4\", \"<= 0.6\"])
@@ -883,7 +908,7 @@ end
yaml_str = @a1.to_yaml
- same_spec = YAML.load(yaml_str)
+ same_spec = YAML.load yaml_str
assert_equal Gem::Platform.new('powerpc-darwin7'), same_spec.platform
assert_equal 'powerpc-darwin7.9.0', same_spec.original_platform
@@ -1173,7 +1198,7 @@ end
@a1.validate
end
- assert_equal "expected RubyGems version #{Gem::RubyGemsVersion}, was 3",
+ assert_equal "expected RubyGems version #{Gem::VERSION}, was 3",
e.message
end
@@ -1228,6 +1253,20 @@ end
assert_equal Gem::Version.new('1'), @a1.version
end
+ def test_load_errors_contain_filename
+ specfile = Tempfile.new(self.class.name.downcase)
+ specfile.write "raise 'boom'"
+ specfile.close
+ begin
+ Gem::Specification.load(specfile.path)
+ rescue => e
+ name_rexp = Regexp.new(Regexp.escape(specfile.path))
+ assert e.backtrace.grep(name_rexp).any?
+ end
+ ensure
+ specfile.delete
+ end
+
def util_setup_validate
Dir.chdir @tempdir do
FileUtils.mkdir_p File.join('ext', 'a')