mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
[ruby/reline] Fix config.rb to File.expand_path $include path in
inputrc
(https://github.com/ruby/reline/pull/592)
* Fix config.rb to File.expand_path $include path in inputrc
* fix bug of test_include_expand_path on Windows
4d34e52d0b
This commit is contained in:
parent
c2c0a083f0
commit
3f1cfc43bd
2 changed files with 18 additions and 1 deletions
|
@ -252,7 +252,7 @@ class Reline::Config
|
||||||
end
|
end
|
||||||
@skip_section = @if_stack.pop
|
@skip_section = @if_stack.pop
|
||||||
when 'include'
|
when 'include'
|
||||||
read(args)
|
read(File.expand_path(args))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -160,6 +160,23 @@ class Reline::Config::Test < Reline::TestCase
|
||||||
assert_equal :audible, @config.instance_variable_get(:@bell_style)
|
assert_equal :audible, @config.instance_variable_get(:@bell_style)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_include_expand_path
|
||||||
|
home_backup = ENV['HOME']
|
||||||
|
File.open('included_partial', 'wt') do |f|
|
||||||
|
f.write(<<~PARTIAL_LINES)
|
||||||
|
set bell-style on
|
||||||
|
PARTIAL_LINES
|
||||||
|
end
|
||||||
|
ENV['HOME'] = Dir.pwd
|
||||||
|
@config.read_lines(<<~LINES.lines)
|
||||||
|
$include ~/included_partial
|
||||||
|
LINES
|
||||||
|
|
||||||
|
assert_equal :audible, @config.instance_variable_get(:@bell_style)
|
||||||
|
ensure
|
||||||
|
ENV['HOME'] = home_backup
|
||||||
|
end
|
||||||
|
|
||||||
def test_if
|
def test_if
|
||||||
@config.read_lines(<<~LINES.lines)
|
@config.read_lines(<<~LINES.lines)
|
||||||
$if Ruby
|
$if Ruby
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue