1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add true condition Reline

This commit is contained in:
Nobuyoshi Nakada 2019-06-02 12:21:09 +09:00 committed by aycabta
parent 06a25344d9
commit d04ebc57f2
2 changed files with 12 additions and 9 deletions

View file

@ -143,6 +143,7 @@ class Reline::Config
when 'version' when 'version'
else # application name else # application name
condition = true if args == 'Ruby' condition = true if args == 'Ruby'
condition = true if args == 'Reline'
end end
unless @skip_section.nil? unless @skip_section.nil?
@if_stack << @skip_section @if_stack << @skip_section

View file

@ -103,16 +103,18 @@ class Reline::Config::Test < Reline::TestCase
end end
def test_if_with_indent def test_if_with_indent
@config.read_lines(<<~LINES.split(/(?<=\n)/)) %w[Ruby Reline].each do |cond|
set bell-style none @config.read_lines(<<~LINES.split(/(?<=\n)/))
$if Ruby set bell-style none
set bell-style audible $if #{cond}
$else set bell-style audible
set bell-style visible $else
$endif set bell-style visible
LINES $endif
LINES
assert_equal :audible, @config.instance_variable_get(:@bell_style) assert_equal :audible, @config.instance_variable_get(:@bell_style)
end
end end
def test_default_key_bindings def test_default_key_bindings