mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Move helper methods to private section of the test file
b85db66e2d
This commit is contained in:
parent
d59b92221d
commit
1090456370
Notes:
git
2020-05-08 14:14:20 +09:00
1 changed files with 24 additions and 24 deletions
|
@ -79,30 +79,6 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def gem_install(name)
|
|
||||||
gem = util_spec name do |s|
|
|
||||||
s.executables = [name]
|
|
||||||
s.files = %W[bin/#{name}]
|
|
||||||
end
|
|
||||||
write_file File.join @tempdir, 'bin', name do |f|
|
|
||||||
f.puts '#!/usr/bin/ruby'
|
|
||||||
end
|
|
||||||
install_gem gem
|
|
||||||
File.join @gemhome, 'bin', name
|
|
||||||
end
|
|
||||||
|
|
||||||
def gem_install_with_plugin(name)
|
|
||||||
gem = util_spec name do |s|
|
|
||||||
s.files = %W[lib/rubygems_plugin.rb]
|
|
||||||
end
|
|
||||||
write_file File.join @tempdir, 'lib', 'rubygems_plugin.rb' do |f|
|
|
||||||
f.puts "require '#{gem.plugins.first}'"
|
|
||||||
end
|
|
||||||
install_gem gem
|
|
||||||
|
|
||||||
File.join Gem.plugindir, "#{name}_plugin.rb"
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_execute_regenerate_binstubs
|
def test_execute_regenerate_binstubs
|
||||||
gem_bin_path = gem_install 'a'
|
gem_bin_path = gem_install 'a'
|
||||||
write_file gem_bin_path do |io|
|
write_file gem_bin_path do |io|
|
||||||
|
@ -389,6 +365,30 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def gem_install(name)
|
||||||
|
gem = util_spec name do |s|
|
||||||
|
s.executables = [name]
|
||||||
|
s.files = %W[bin/#{name}]
|
||||||
|
end
|
||||||
|
write_file File.join @tempdir, 'bin', name do |f|
|
||||||
|
f.puts '#!/usr/bin/ruby'
|
||||||
|
end
|
||||||
|
install_gem gem
|
||||||
|
File.join @gemhome, 'bin', name
|
||||||
|
end
|
||||||
|
|
||||||
|
def gem_install_with_plugin(name)
|
||||||
|
gem = util_spec name do |s|
|
||||||
|
s.files = %W[lib/rubygems_plugin.rb]
|
||||||
|
end
|
||||||
|
write_file File.join @tempdir, 'lib', 'rubygems_plugin.rb' do |f|
|
||||||
|
f.puts "require '#{gem.plugins.first}'"
|
||||||
|
end
|
||||||
|
install_gem gem
|
||||||
|
|
||||||
|
File.join Gem.plugindir, "#{name}_plugin.rb"
|
||||||
|
end
|
||||||
|
|
||||||
def default_gem_bin_path
|
def default_gem_bin_path
|
||||||
gem_exec = sprintf Gem.default_exec_format, 'gem'
|
gem_exec = sprintf Gem.default_exec_format, 'gem'
|
||||||
File.join @install_dir, 'bin', gem_exec
|
File.join @install_dir, 'bin', gem_exec
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue