зеркало из https://github.com/github/ruby.git
test/irb/test_raise_no_backtrace_exception.rb: fix test file path
Create a file for test under the temporary directory.
This commit is contained in:
Родитель
79717f81f8
Коммит
34bc8210ed
|
@ -29,7 +29,7 @@ IRB
|
|||
ENV["HOME"] = tmpdir
|
||||
|
||||
bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : []
|
||||
File.open('euc.rb', 'w') do |f|
|
||||
File.open("#{tmpdir}/euc.rb", 'w') do |f|
|
||||
f.write(<<~EOF)
|
||||
# encoding: euc-jp
|
||||
|
||||
|
@ -40,7 +40,9 @@ IRB
|
|||
end
|
||||
env = {}
|
||||
%w(LC_MESSAGES LC_ALL LC_CTYPE LANG).each {|n| env[n] = "ja_JP.UTF-8" }
|
||||
assert_in_out_err([env] + bundle_exec + %w[-rirb -W0 -e IRB.start(__FILE__) -- -f --], <<~IRB, /`raise_euc_with_invalid_byte_sequence': あ\\xFF \(RuntimeError\)/, [], encoding: "UTF-8")
|
||||
args = [env] + bundle_exec + %W[-rirb -C #{tmpdir} -W0 -e IRB.start(__FILE__) -- -f --]
|
||||
error = /`raise_euc_with_invalid_byte_sequence': あ\\xFF \(RuntimeError\)/
|
||||
assert_in_out_err(args, <<~IRB, error, [], encoding: "UTF-8")
|
||||
require_relative 'euc'
|
||||
raise_euc_with_invalid_byte_sequence
|
||||
IRB
|
||||
|
|
Загрузка…
Ссылка в новой задаче