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:
parent
06a25344d9
commit
d04ebc57f2
2 changed files with 12 additions and 9 deletions
|
@ -143,6 +143,7 @@ class Reline::Config
|
|||
when 'version'
|
||||
else # application name
|
||||
condition = true if args == 'Ruby'
|
||||
condition = true if args == 'Reline'
|
||||
end
|
||||
unless @skip_section.nil?
|
||||
@if_stack << @skip_section
|
||||
|
|
|
@ -103,16 +103,18 @@ class Reline::Config::Test < Reline::TestCase
|
|||
end
|
||||
|
||||
def test_if_with_indent
|
||||
@config.read_lines(<<~LINES.split(/(?<=\n)/))
|
||||
set bell-style none
|
||||
$if Ruby
|
||||
set bell-style audible
|
||||
$else
|
||||
set bell-style visible
|
||||
$endif
|
||||
LINES
|
||||
%w[Ruby Reline].each do |cond|
|
||||
@config.read_lines(<<~LINES.split(/(?<=\n)/))
|
||||
set bell-style none
|
||||
$if #{cond}
|
||||
set bell-style audible
|
||||
$else
|
||||
set bell-style visible
|
||||
$endif
|
||||
LINES
|
||||
|
||||
assert_equal :audible, @config.instance_variable_get(:@bell_style)
|
||||
assert_equal :audible, @config.instance_variable_get(:@bell_style)
|
||||
end
|
||||
end
|
||||
|
||||
def test_default_key_bindings
|
||||
|
|
Loading…
Reference in a new issue