Skip to content

Commit

Permalink
Rename RuboCop::AST::Token#regexp_dot? to `RuboCop::AST::Token#rege…
Browse files Browse the repository at this point in the history
…xp_dots`

Follow up #235 (comment).

This PR renames `RuboCop::AST::Token#regexp_dot?` to `RuboCop::AST::Token#regexp_dots`.
It's been determined that it doesn't need to be an alias because it's the API that
has just been released and isn't widespread.
  • Loading branch information
koic authored and marcandre committed Jul 10, 2022
1 parent 1583820 commit 99156b4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog/change_rename_regexp_dot_to_regexp_dots.md
@@ -0,0 +1 @@
* [#236](https://github.com/rubocop-hq/rubocop-ast/pull/236): **(Potentially Breaking)** Rename `RuboCop::AST::Token#regexp_dot?` to `RuboCop::AST::Token#regexp_dots`. ([@koic][])
2 changes: 1 addition & 1 deletion lib/rubocop/ast/token.rb
Expand Up @@ -100,7 +100,7 @@ def comma?
type == :tCOMMA
end

def regexp_dot?
def regexp_dots?
%i[tDOT2 tDOT3].include?(type)
end

Expand Down
10 changes: 5 additions & 5 deletions spec/rubocop/ast/token_spec.rb
Expand Up @@ -236,15 +236,15 @@ def some_method
end
end

describe '#regexp_dot?' do
describe '#regexp_dots?' do
it 'returns true for regexp tokens' do
expect(irange_token).to be_regexp_dot
expect(erange_token).to be_regexp_dot
expect(irange_token).to be_regexp_dots
expect(erange_token).to be_regexp_dots
end

it 'returns false for non comma tokens' do
expect(semicolon_token).not_to be_regexp_dot
expect(right_ref_bracket_token).not_to be_regexp_dot
expect(semicolon_token).not_to be_regexp_dots
expect(right_ref_bracket_token).not_to be_regexp_dots
end
end

Expand Down

0 comments on commit 99156b4

Please sign in to comment.