ruby-changes:58397
From: Sutou <ko1@a...>
Date: Thu, 24 Oct 2019 19:36:17 +0900 (JST)
Subject: [ruby-changes:58397] 4d844cbaed (master): [ruby/fiddle] test: use env Hash
https://git.ruby-lang.org/ruby.git/commit/?id=4d844cbaed From 4d844cbaed518743776594fa5ae33b86fe176ad1 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei <kou@c...> Date: Tue, 28 May 2019 06:04:19 +0900 Subject: [ruby/fiddle] test: use env Hash https://github.com/ruby/fiddle/commit/a01a962342 diff --git a/test/fiddle/test_import.rb b/test/fiddle/test_import.rb index e243105..3170e9e 100644 --- a/test/fiddle/test_import.rb +++ b/test/fiddle/test_import.rb @@ -149,18 +149,21 @@ module Fiddle https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_import.rb#L149 end def test_no_message_with_debug - # disable all Ruby environment variables - orig_RUBYOPT, ENV['RUBYOPT'] = ENV['RUBYOPT'], nil - orig_RUBYLIB, ENV['RUBYLIB'] = ENV['RUBYLIB'], nil - # load development fiddle instead of bundled one libdir = File.expand_path('../../../lib', __FILE__) - ENV['RUBYLIB'] = libdir if File.file?(File.join(libdir, "fiddle/import.rb")) - - assert_in_out_err(%w[--debug --disable=gems -rfiddle/import], 'p Fiddle::Importer', ['Fiddle::Importer']) - ensure - ENV['RUBYLIB'] = orig_RUBYLIB - ENV['RUBYOPT'] = orig_RUBYOPT + libdir = nil unless File.file?(File.join(libdir, "fiddle/import.rb")) + assert_in_out_err([ + # disable all Ruby environment variables + { + "RUBYOPT" => nil, + "RUBYLIB" => libdir, + }, + "--debug", + "--disable=gems", + "-rfiddle/import", + ], + 'p Fiddle::Importer', + ['Fiddle::Importer']) end end end if defined?(Fiddle) -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/