File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 41
41
CHANGELOG
42
42
end
43
43
44
+ let ( :duplicate_entry ) do
45
+ Changelog ::Entry . new ( type : :fix , body : 'Duplicate contributor name entry' , user : 'johndoe' )
46
+ end
47
+
44
48
let ( :entries ) do
45
49
%i[ fix new fix ] . map . with_index do |type , i |
46
50
Changelog ::Entry . new ( type : type , body : "Do something cool#{ 'x' * i } " , user : "johndoe#{ 'x' * i } " )
47
- end
51
+ end << duplicate_entry
48
52
end
49
53
let ( :entry ) { entries . first }
50
54
72
76
73
77
* [#x](https://github.com/rubocop/rubocop-ast/pull/x): Do something cool. ([@johndoe][])
74
78
* [#x](https://github.com/rubocop/rubocop-ast/pull/x): Do something coolxx. ([@johndoexx][])
79
+ * [#x](https://github.com/rubocop/rubocop-ast/pull/x): Duplicate contributor name entry. ([@johndoe][])
75
80
CHANGELOG
76
81
77
82
expect ( changelog . new_contributor_lines ) . to eq (
Original file line number Diff line number Diff line change @@ -134,9 +134,9 @@ def merge_content
134
134
end
135
135
136
136
def new_contributor_lines
137
- contributors
138
- . map { | user | format ( CONTRIBUTOR , user : user ) }
139
- . reject { |line | @rest . include? ( line ) }
137
+ unique_contributor_names = contributors . map { | user | format ( CONTRIBUTOR , user : user ) } . uniq
138
+
139
+ unique_contributor_names . reject { |line | @rest . include? ( line ) }
140
140
end
141
141
142
142
def contributors
You can’t perform that action at this time.
0 commit comments