Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BreakNode / ReturnNode / NextNode: Multiple fixes #70

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions lib/rubocop/ast/node/break_node.rb
Expand Up @@ -9,9 +9,7 @@ class BreakNode < Node
include MethodDispatchNode
include ParameterizedNode

def arguments
[]
end
alias arguments children
end
end
end
6 changes: 6 additions & 0 deletions spec/rubocop/ast/break_node_spec.rb
Expand Up @@ -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