Skip to content

Commit

Permalink
Add true condition Reline
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu authored and aycabta committed Jun 2, 2019
1 parent 06a2534 commit d04ebc5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions lib/reline/config.rb
Expand Up @@ -143,6 +143,7 @@ def handle_directive(directive)
when 'version'
else # application name
condition = true if args == 'Ruby'
condition = true if args == 'Reline'
end
unless @skip_section.nil?
@if_stack << @skip_section
Expand Down
22 changes: 12 additions & 10 deletions test/reline/test_config.rb
Expand Up @@ -103,16 +103,18 @@ def test_if_with_false
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

assert_equal :audible, @config.instance_variable_get(:@bell_style)
%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)
end
end

def test_default_key_bindings
Expand Down

0 comments on commit d04ebc5

Please sign in to comment.