From d04ebc57f232e1a2ca36bd3d5ed9a24f63ee43d6 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 2 Jun 2019 12:21:09 +0900 Subject: [PATCH] Add true condition `Reline` --- lib/reline/config.rb | 1 + test/reline/test_config.rb | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/reline/config.rb b/lib/reline/config.rb index b5ed6a89ba..6330f777d3 100644 --- a/lib/reline/config.rb +++ b/lib/reline/config.rb @@ -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 diff --git a/test/reline/test_config.rb b/test/reline/test_config.rb index 1e65c885d0..bb9bb30a36 100644 --- a/test/reline/test_config.rb +++ b/test/reline/test_config.rb @@ -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