From d4c035a2f39b24308bee3173a3fc6b79257e4712 Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Sun, 7 Jun 2020 02:40:07 -0400 Subject: [PATCH] Rename new option predicate to avoid conflict with existing Node method [#20] --- lib/rubocop/ast/node/regexp_node.rb | 2 +- spec/rubocop/ast/regexp_node_spec.rb | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/rubocop/ast/node/regexp_node.rb b/lib/rubocop/ast/node/regexp_node.rb index 783c8c698..14c33b104 100644 --- a/lib/rubocop/ast/node/regexp_node.rb +++ b/lib/rubocop/ast/node/regexp_node.rb @@ -38,7 +38,7 @@ def interpolation? end # @return [Bool] if regexp uses the multiline regopt - def multiline? + def multiline_mode? regopt_include?(:m) end diff --git a/spec/rubocop/ast/regexp_node_spec.rb b/spec/rubocop/ast/regexp_node_spec.rb index f0b319bb8..580a98287 100644 --- a/spec/rubocop/ast/regexp_node_spec.rb +++ b/spec/rubocop/ast/regexp_node_spec.rb @@ -161,29 +161,29 @@ end end - describe '#multiline?' do + describe '#multiline_mode?' do context 'with no options' do let(:source) { '/x/' } - it { expect(regexp_node.multiline?).to be(false) } + it { expect(regexp_node.multiline_mode?).to be(false) } end context 'with other options' do let(:source) { '/x/ix' } - it { expect(regexp_node.multiline?).to be(false) } + it { expect(regexp_node.multiline_mode?).to be(false) } end context 'with only m option' do let(:source) { '/x/m' } - it { expect(regexp_node.multiline?).to be(true) } + it { expect(regexp_node.multiline_mode?).to be(true) } end context 'with m and other options' do let(:source) { '/x/imx' } - it { expect(regexp_node.multiline?).to be(true) } + it { expect(regexp_node.multiline_mode?).to be(true) } end end