mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* gc.c (rb_gc_set_params): allow GC parameter configuration by
environment variables. based on a patch from funny-falcon at https://gist.github.com/856296, but honors safe level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c414d861c1
commit
eb807d42ec
67 changed files with 773 additions and 1845 deletions
|
|
@ -12,19 +12,19 @@ class TestGemUninstaller < Gem::InstallerTestCase
|
|||
def setup
|
||||
super
|
||||
|
||||
@user_spec.executables = ["executable"]
|
||||
@user_spec.executables = ["my_exec"]
|
||||
|
||||
# HACK util_make_exec
|
||||
user_bin_dir = File.join Gem.user_dir, 'gems', @user_spec.full_name, 'bin'
|
||||
FileUtils.mkdir_p user_bin_dir
|
||||
exec_path = File.join user_bin_dir, "executable"
|
||||
exec_path = File.join user_bin_dir, "my_exec"
|
||||
open exec_path, 'w' do |f|
|
||||
f.puts "#!/usr/bin/ruby"
|
||||
end
|
||||
|
||||
user_bin_dir = File.join Gem.user_dir, 'bin'
|
||||
FileUtils.mkdir_p user_bin_dir
|
||||
exec_path = File.join user_bin_dir, "executable"
|
||||
exec_path = File.join user_bin_dir, "my_exec"
|
||||
open exec_path, 'w' do |f|
|
||||
f.puts "#!/usr/bin/ruby"
|
||||
end
|
||||
|
|
@ -47,8 +47,8 @@ class TestGemUninstaller < Gem::InstallerTestCase
|
|||
def test_remove_executables_force_keep
|
||||
uninstaller = Gem::Uninstaller.new nil, :executables => false
|
||||
|
||||
executable = File.join Gem.user_dir, 'bin', 'executable'
|
||||
assert File.exist?(executable), 'executable not written'
|
||||
executable = File.join Gem.user_dir, 'bin', 'my_exec'
|
||||
assert File.exist? executable
|
||||
|
||||
use_ui @ui do
|
||||
uninstaller.remove_executables @user_spec
|
||||
|
|
@ -62,14 +62,14 @@ class TestGemUninstaller < Gem::InstallerTestCase
|
|||
def test_remove_executables_force_remove
|
||||
uninstaller = Gem::Uninstaller.new nil, :executables => true
|
||||
|
||||
executable = File.join Gem.user_dir, 'bin', 'executable'
|
||||
assert File.exist?(executable), 'executable not written'
|
||||
executable = File.join Gem.user_dir, 'bin', 'my_exec'
|
||||
assert File.exist? executable
|
||||
|
||||
use_ui @ui do
|
||||
uninstaller.remove_executables @user_spec
|
||||
end
|
||||
|
||||
assert_equal "Removing executable\n", @ui.output
|
||||
assert_equal "Removing my_exec\n", @ui.output
|
||||
|
||||
refute File.exist? executable
|
||||
end
|
||||
|
|
@ -81,47 +81,12 @@ class TestGemUninstaller < Gem::InstallerTestCase
|
|||
uninstaller.remove_executables @user_spec
|
||||
end
|
||||
|
||||
exec_path = File.join Gem.user_dir, 'bin', 'executable'
|
||||
exec_path = File.join Gem.user_dir, 'bin', 'my_exec'
|
||||
assert_equal false, File.exist?(exec_path), 'removed exec from bin dir'
|
||||
|
||||
assert_equal "Removing executable\n", @ui.output
|
||||
assert_equal "Removing my_exec\n", @ui.output
|
||||
end
|
||||
|
||||
def test_remove_executables_user_format
|
||||
Gem::Installer.exec_format = 'foo-%s-bar'
|
||||
|
||||
uninstaller = Gem::Uninstaller.new nil, :executables => true, :format_executable => true
|
||||
|
||||
use_ui @ui do
|
||||
uninstaller.remove_executables @user_spec
|
||||
end
|
||||
|
||||
exec_path = File.join Gem.user_dir, 'bin', 'foo-executable-bar'
|
||||
assert_equal false, File.exist?(exec_path), 'removed exec from bin dir'
|
||||
|
||||
assert_equal "Removing executable\n", @ui.output
|
||||
ensure
|
||||
Gem::Installer.exec_format = nil
|
||||
end
|
||||
|
||||
def test_remove_executables_user_format_disabled
|
||||
Gem::Installer.exec_format = 'foo-%s-bar'
|
||||
|
||||
uninstaller = Gem::Uninstaller.new nil, :executables => true
|
||||
|
||||
use_ui @ui do
|
||||
uninstaller.remove_executables @user_spec
|
||||
end
|
||||
|
||||
exec_path = File.join Gem.user_dir, 'bin', 'executable'
|
||||
assert_equal false, File.exist?(exec_path), 'removed exec from bin dir'
|
||||
|
||||
assert_equal "Removing executable\n", @ui.output
|
||||
ensure
|
||||
Gem::Installer.exec_format = nil
|
||||
end
|
||||
|
||||
|
||||
def test_path_ok_eh
|
||||
uninstaller = Gem::Uninstaller.new nil
|
||||
|
||||
|
|
@ -164,31 +129,6 @@ class TestGemUninstaller < Gem::InstallerTestCase
|
|||
assert_same uninstaller, @post_uninstall_hook_arg
|
||||
end
|
||||
|
||||
def test_uninstall_not_ok
|
||||
quick_gem 'z' do |s|
|
||||
s.add_runtime_dependency @spec.name
|
||||
end
|
||||
|
||||
uninstaller = Gem::Uninstaller.new @spec.name
|
||||
|
||||
gem_dir = File.join @gemhome, 'gems', @spec.full_name
|
||||
executable = File.join @gemhome, 'bin', 'executable'
|
||||
|
||||
assert File.exist?(gem_dir), 'gem_dir must exist'
|
||||
assert File.exist?(executable), 'executable must exist'
|
||||
|
||||
ui = Gem::MockGemUi.new "n\n"
|
||||
|
||||
assert_raises Gem::DependencyRemovalException do
|
||||
use_ui ui do
|
||||
uninstaller.uninstall
|
||||
end
|
||||
end
|
||||
|
||||
assert File.exist?(gem_dir), 'gem_dir must still exist'
|
||||
assert File.exist?(executable), 'executable must still exist'
|
||||
end
|
||||
|
||||
def test_uninstall_user
|
||||
uninstaller = Gem::Uninstaller.new @user_spec.name, :executables => true,
|
||||
:user_install => true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue