mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/fiddle] test: use env Hash
https://github.com/ruby/fiddle/commit/a01a962342
This commit is contained in:
parent
5ebb0d50f6
commit
4d844cbaed
1 changed files with 13 additions and 10 deletions
|
@ -149,18 +149,21 @@ module Fiddle
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_no_message_with_debug
|
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
|
# load development fiddle instead of bundled one
|
||||||
libdir = File.expand_path('../../../lib', __FILE__)
|
libdir = File.expand_path('../../../lib', __FILE__)
|
||||||
ENV['RUBYLIB'] = libdir if File.file?(File.join(libdir, "fiddle/import.rb"))
|
libdir = nil unless File.file?(File.join(libdir, "fiddle/import.rb"))
|
||||||
|
assert_in_out_err([
|
||||||
assert_in_out_err(%w[--debug --disable=gems -rfiddle/import], 'p Fiddle::Importer', ['Fiddle::Importer'])
|
# disable all Ruby environment variables
|
||||||
ensure
|
{
|
||||||
ENV['RUBYLIB'] = orig_RUBYLIB
|
"RUBYOPT" => nil,
|
||||||
ENV['RUBYOPT'] = orig_RUBYOPT
|
"RUBYLIB" => libdir,
|
||||||
|
},
|
||||||
|
"--debug",
|
||||||
|
"--disable=gems",
|
||||||
|
"-rfiddle/import",
|
||||||
|
],
|
||||||
|
'p Fiddle::Importer',
|
||||||
|
['Fiddle::Importer'])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end if defined?(Fiddle)
|
end if defined?(Fiddle)
|
||||||
|
|
Loading…
Add table
Reference in a new issue