summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-19 21:23:04 +0000
committerryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-19 21:23:04 +0000
commit64847a9cfe467b808ca5e8148dfa85a059198963 ()
treeb21ca4404f92f1fe269347a8d624cf188e7fbc97 /test
parentdf2762fb1aaa82577b4e3e8df67cc56b7aefdfb8 (diff)
Importing rubygems @ c2d4131: Deal with platforms that have DLEXT2 == nil. Fixes RF#28867
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/rubygems/gemutilities.rb7
-rw-r--r--test/rubygems/test_gem_commands_sources_command.rb8
-rw-r--r--test/rubygems/test_gem_installer.rb108
3 files changed, 113 insertions, 10 deletions
@@ -130,11 +130,17 @@ class RubyGemTestCase < MiniTest::Unit::TestCase
@public_cert = File.expand_path File.join(File.dirname(__FILE__),
'public_cert.pem')
Gem.post_install_hooks.clear
Gem.post_uninstall_hooks.clear
Gem.pre_install_hooks.clear
Gem.pre_uninstall_hooks.clear
Gem.post_install do |installer|
@post_install_hook_arg = installer
end
@@ -145,6 +151,7 @@ class RubyGemTestCase < MiniTest::Unit::TestCase
Gem.pre_install do |installer|
@pre_install_hook_arg = installer
end
Gem.pre_uninstall do |uninstaller|
@@ -90,7 +90,9 @@ class TestGemCommandsSourcesCommand < RubyGemTestCase
util_setup_spec_fetcher
use_ui @ui do
- @cmd.execute
end
expected = <<-EOF
@@ -108,7 +110,9 @@ Error fetching http://beta-gems.example.com:
util_setup_spec_fetcher
use_ui @ui do
- @cmd.execute
end
assert_equal [@gem_repo], Gem.sources
@@ -521,15 +521,27 @@ load Gem.bin_path('a', 'my_exec', version)
def test_install
Dir.mkdir util_inst_bindir
util_setup_gem
cache_file = File.join @gemhome, 'cache', @spec.file_name
Gem.pre_install do |installer|
- refute File.exist?(cache_file), 'cache file should not exist yet'
end
Gem.post_install do |installer|
- assert File.exist?(cache_file), 'cache file should exist'
end
build_rake_in do
@@ -538,25 +550,27 @@ load Gem.bin_path('a', 'my_exec', version)
end
end
- gemdir = File.join @gemhome, 'gems', @spec.full_name
- assert File.exist?(gemdir)
- exe = File.join(gemdir, 'bin', 'executable')
- assert File.exist?(exe)
exe_mode = File.stat(exe).mode & 0111
assert_equal 0111, exe_mode, "0%o" % exe_mode unless win_platform?
assert File.exist?(File.join(gemdir, 'lib', 'code.rb'))
- assert File.exist?(File.join(gemdir, 'ext', 'a', 'Rakefile'))
spec_file = File.join(@gemhome, 'specifications', @spec.spec_name)
assert_equal spec_file, @spec.loaded_from
assert File.exist?(spec_file)
- assert_same @installer, @pre_install_hook_arg
assert_same @installer, @post_install_hook_arg
end
def test_install_bad_gem
@@ -669,6 +683,84 @@ load Gem.bin_path('a', 'my_exec', version)
assert File.exist?(File.join(@gemhome, 'specifications', @spec.spec_name))
end
def test_install_with_message
@spec.post_install_message = 'I am a shiny gem!'