summaryrefslogtreecommitdiff
path: root/test/rubygems
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-05-11 21:00:54 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-05-12 17:24:43 +0900
commitbef49e6e8d03a34b95f3e69ef7d23395027a44d2 (patch)
tree5a0602cf01cab8401a6ce2d8fecfb5aa1adfa482 /test/rubygems
parentb314885af0dad39cad1d556c574a41eb785d8703 (diff)
[rubygems/rubygems] Added begin-end block for java platform
Because pend of test-unit raises exception. https://github.com/rubygems/rubygems/commit/b5e2d0855a
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4491
Diffstat (limited to 'test/rubygems')
-rw-r--r--test/rubygems/test_gem_installer.rb70
1 files changed, 36 insertions, 34 deletions
diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb
index 1619a309f7..1180e3a609 100644
--- a/test/rubygems/test_gem_installer.rb
+++ b/test/rubygems/test_gem_installer.rb
@@ -1525,50 +1525,52 @@ gem 'other', version
def test_install_extension_flat
skip "extensions don't quite work on jruby" if Gem.java_platform?
- @spec = setup_base_spec
- @spec.require_paths = ["."]
+ begin
+ @spec = setup_base_spec
+ @spec.require_paths = ["."]
- @spec.extensions << "extconf.rb"
+ @spec.extensions << "extconf.rb"
- write_file File.join(@tempdir, "extconf.rb") do |io|
- io.write <<-RUBY
- require "mkmf"
+ write_file File.join(@tempdir, "extconf.rb") do |io|
+ io.write <<-RUBY
+ require "mkmf"
- CONFIG['CC'] = '$(TOUCH) $@ ||'
- CONFIG['LDSHARED'] = '$(TOUCH) $@ ||'
- $ruby = '#{Gem.ruby}'
+ CONFIG['CC'] = '$(TOUCH) $@ ||'
+ CONFIG['LDSHARED'] = '$(TOUCH) $@ ||'
+ $ruby = '#{Gem.ruby}'
- create_makefile("#{@spec.name}")
- RUBY
- end
+ create_makefile("#{@spec.name}")
+ RUBY
+ end
- # empty depend file for no auto dependencies
- @spec.files += %W[depend #{@spec.name}.c].each do |file|
- write_file File.join(@tempdir, file)
- end
+ # empty depend file for no auto dependencies
+ @spec.files += %W[depend #{@spec.name}.c].each do |file|
+ write_file File.join(@tempdir, file)
+ end
- so = File.join(@spec.gem_dir, "#{@spec.name}.#{RbConfig::CONFIG["DLEXT"]}")
- assert_path_not_exist so
- use_ui @ui do
- path = Gem::Package.build @spec
+ so = File.join(@spec.gem_dir, "#{@spec.name}.#{RbConfig::CONFIG["DLEXT"]}")
+ assert_path_not_exist so
+ use_ui @ui do
+ path = Gem::Package.build @spec
- installer = Gem::Installer.at path
- installer.install
- end
- assert_path_exist so
- rescue
- puts '-' * 78
- puts File.read File.join(@gemhome, 'gems', 'a-2', 'Makefile')
- puts '-' * 78
+ installer = Gem::Installer.at path
+ installer.install
+ end
+ assert_path_exist so
+ rescue
+ puts '-' * 78
+ puts File.read File.join(@gemhome, 'gems', 'a-2', 'Makefile')
+ puts '-' * 78
- path = File.join(@gemhome, 'gems', 'a-2', 'gem_make.out')
+ path = File.join(@gemhome, 'gems', 'a-2', 'gem_make.out')
- if File.exist?(path)
- puts File.read(path)
- puts '-' * 78
- end
+ if File.exist?(path)
+ puts File.read(path)
+ puts '-' * 78
+ end
- raise
+ raise
+ end
end
def test_installation_satisfies_dependency_eh