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