Skip to content

Commit

Permalink
Satisfy rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre committed Mar 1, 2024
1 parent e88f950 commit 63a0eba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion spec/rubocop/ast/node_pattern_spec.rb
Expand Up @@ -56,7 +56,7 @@ def not_match_codes(*codes)
shared_examples 'invalid' do
it 'is invalid' do
expect { instance }
.to raise_error(RuboCop::AST::NodePattern::Invalid)
.to raise_error(described_class::Invalid)
end
end

Expand Down
6 changes: 3 additions & 3 deletions spec/rubocop/ast/traversal_spec.rb
Expand Up @@ -95,7 +95,7 @@ def initialize
end

it 'knows all current node types' do
expect(RuboCop::AST::Traversal::MISSING).to eq []
expect(described_class::MISSING).to eq []
end

# Sanity checking the debugging checks
Expand All @@ -107,15 +107,15 @@ def initialize
let(:node) { s(:int) }

it 'raises debugging error' do
expect { traverse }.to raise_error(RuboCop::AST::Traversal::DebugError)
expect { traverse }.to raise_error(described_class::DebugError)
end
end

context 'with too many children' do
let(:node) { s(:int, 1, 2) }

it 'raises debugging error' do
expect { traverse }.to raise_error(RuboCop::AST::Traversal::DebugError)
expect { traverse }.to raise_error(described_class::DebugError)
end
end
end
Expand Down
15 changes: 7 additions & 8 deletions spec/tasks/changelog_spec.rb
Expand Up @@ -42,22 +42,21 @@
end

let(:duplicate_entry) do
Changelog::Entry.new(type: :fix, body: 'Duplicate contributor name entry', user: 'johndoe')
described_class::Entry.new(type: :fix, body: 'Duplicate contributor name entry', user: 'johndoe')
end

let(:entries) do
%i[fix new fix].map.with_index do |type, i|
Changelog::Entry.new(type: type, body: "Do something cool#{'x' * i}", user: "johndoe#{'x' * i}")
described_class::Entry.new(type: type, body: "Do something cool#{'x' * i}",
user: "johndoe#{'x' * i}")
end << duplicate_entry
end
let(:entry) { entries.first }

describe Changelog::Entry do
it 'generates correct content' do
expect(entry.content).to eq <<~MD
* [#x](https://github.com/rubocop/rubocop-ast/pull/x): Do something cool. ([@johndoe][])
MD
end
it 'Changelog::Entry generates correct content' do
expect(entry.content).to eq <<~MD
* [#x](https://github.com/rubocop/rubocop-ast/pull/x): Do something cool. ([@johndoe][])
MD
end

it 'parses correctly' do
Expand Down

0 comments on commit 63a0eba

Please sign in to comment.