From 756a8081559ec6bcb6102a0db360649d33d0c137 Mon Sep 17 00:00:00 2001 From: Richard Stewart Date: Sat, 24 Sep 2022 18:05:11 +0900 Subject: [PATCH] Add a project spec for future changelog entry Follow up https://github.com/rubocop/rubocop/pull/10991. --- CONTRIBUTING.md | 1 - spec/project_spec.rb | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d0e9780..fb788a3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,7 +50,6 @@ Here are a few examples: ``` * [#716](https://github.com/rubocop/rubocop-performance/issues/716): Fixed a regression in the autocorrection logic of `MethodDefParentheses`. ([@bbatsov][]) -* New cop `ElseLayout` checks for odd arrangement of code in the `else` branch of a conditional expression. ([@bbatsov][]) ``` * Create one file `changelog/{type}_{some_description}.md`, where `type` is `new` (New feature), `fix` or `change`, and `some_description` is unique to avoid conflicts. Task `changelog:fix` (or `:new` or `:change`) can help you. diff --git a/spec/project_spec.rb b/spec/project_spec.rb index 25503d1..b18afd1 100644 --- a/spec/project_spec.rb +++ b/spec/project_spec.rb @@ -213,6 +213,13 @@ include_examples 'has Changelog format' + it 'has a link to the issue or pull request address at the beginning' do + repo = 'rubocop/rubocop-performance' + address_pattern = %r{\A\* \[#\d+\]\(https://github\.com/#{repo}/(issues|pull)/\d+\):} + + expect(entries).to all(match(address_pattern)) + end + it 'has a link to the contributors at the end' do expect(entries).to all(match(/\(\[@\S+\]\[\](?:, \[@\S+\]\[\])*\)$/)) end