diff --git a/CHANGELOG.md b/CHANGELOG.md index 79f329ed3..617d36ef5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ ### Bug fixes +* [#70](https://github.com/rubocop-hq/rubocop-ast/pull/70): Fix arguments processing for `BreakNode` ([@marcandre][]) * [#55](https://github.com/rubocop-hq/rubocop-ast/pull/55): Fix `ProcessedSource#commented?` for multi-line ranges. Renamed `contains_comment?` ([@marcandre][]) ## 0.1.0 (2020-06-26) diff --git a/lib/rubocop/ast/node/break_node.rb b/lib/rubocop/ast/node/break_node.rb index 032aded7e..453637c00 100644 --- a/lib/rubocop/ast/node/break_node.rb +++ b/lib/rubocop/ast/node/break_node.rb @@ -9,9 +9,7 @@ class BreakNode < Node include MethodDispatchNode include ParameterizedNode - def arguments - [] - end + alias arguments children end end end diff --git a/spec/rubocop/ast/break_node_spec.rb b/spec/rubocop/ast/break_node_spec.rb index 0fbf64360..5267e38f7 100644 --- a/spec/rubocop/ast/break_node_spec.rb +++ b/spec/rubocop/ast/break_node_spec.rb @@ -10,4 +10,10 @@ it { expect(break_node.is_a?(described_class)).to be(true) } end end + + describe '#arguments' do + let(:source) { 'break 1, 2' } + + it { expect(break_node.arguments.size).to eq 2 } + end end