aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_specification.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-07 00:53:01 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-07 00:53:01 +0000
commit97f80207d0f0d13f28a419d8c92e96bb9064096a (patch)
treede416fff9bbc978434cb4c1185099151df2ac27c /test/rubygems/test_gem_specification.rb
parenta0b80a44101708b5d66cdd87f16c98277954a77c (diff)
downloadruby-97f80207d0f0d13f28a419d8c92e96bb9064096a.tar.gz
* lib/rubygems: Update to RubyGems 2.4.5.
* test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48729 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, 50 insertions, 1 deletions
diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb
index dd626d9292..3cadc55d5d 100644
--- a/test/rubygems/test_gem_specification.rb
+++ b/test/rubygems/test_gem_specification.rb
@@ -1353,7 +1353,7 @@ dependencies: []
end
expected = "Ignoring ext-1 because its extensions are not built. " +
- "Try: gem pristine ext-1\n"
+ "Try: gem pristine ext --version 1\n"
assert_equal expected, err
end
@@ -1863,6 +1863,43 @@ dependencies: []
assert_equal expected, @ext.full_require_paths
end
+ def test_to_fullpath
+ ext_spec
+
+ @ext.require_paths = 'lib'
+
+ dir = File.join(@gemhome, 'gems', @ext.original_name, 'lib')
+ expected_rb = File.join(dir, 'code.rb')
+ FileUtils.mkdir_p dir
+ FileUtils.touch expected_rb
+
+ dir = @ext.extension_dir
+ ext = RbConfig::CONFIG["DLEXT"]
+ expected_so = File.join(dir, "ext.#{ext}")
+ FileUtils.mkdir_p dir
+ FileUtils.touch expected_so
+
+ assert_nil @ext.to_fullpath("code")
+ assert_nil @ext.to_fullpath("code.rb")
+ assert_nil @ext.to_fullpath("code.#{ext}")
+
+ assert_nil @ext.to_fullpath("ext")
+ assert_nil @ext.to_fullpath("ext.rb")
+ assert_nil @ext.to_fullpath("ext.#{ext}")
+
+ @ext.activate
+
+ assert_equal expected_rb, @ext.to_fullpath("code")
+ assert_equal expected_rb, @ext.to_fullpath("code.rb")
+ assert_nil @ext.to_fullpath("code.#{ext}")
+
+ assert_equal expected_so, @ext.to_fullpath("ext")
+ assert_nil @ext.to_fullpath("ext.rb")
+ assert_equal expected_so, @ext.to_fullpath("ext.#{ext}")
+
+ assert_nil @ext.to_fullpath("notexist")
+ end
+
def test_require_already_activated
save_loaded_features do
a1 = new_spec "a", "1", nil, "lib/d.rb"
@@ -3010,6 +3047,18 @@ end
assert_equal ["default-2.0.0.0"], Gem::Specification.map(&:full_name)
end
+ def test_detect_bundled_gem_in_old_ruby
+ util_set_RUBY_VERSION '1.9.3', 551
+
+ spec = new_spec 'bigdecimal', '1.1.0' do |s|
+ s.summary = "This bigdecimal is bundled with Ruby"
+ end
+
+ assert spec.bundled_gem_in_old_ruby?
+ ensure
+ util_restore_RUBY_VERSION
+ end
+
def util_setup_deps
@gem = util_spec "awesome", "1.0" do |awesome|
awesome.add_runtime_dependency "bonobo", []