spec/project/changelog_spec.rb in rubocop-rspec-1.13.0 vs spec/project/changelog_spec.rb in rubocop-rspec-1.14.0

- old
+ new

@@ -8,22 +8,19 @@ end end describe 'entry' do subject(:entries) { lines.grep(/^\*/).map(&:chomp) } + let(:lines) { changelog.each_line } it 'has a whitespace between the * and the body' do - entries.each do |entry| - expect(entry).to match(/^\* \S/) - end + expect(entries).to all(match(/^\* \S/)) end it 'has a link to the contributors at the end' do - entries.each do |entry| - expect(entry).to match(/\(\[@\S+\]\[\](?:, \[@\S+\]\[\])*\)$/) - end + expect(entries).to all(match(/\(\[@\S+\]\[\](?:, \[@\S+\]\[\])*\)$/)) end describe 'link to related issue on github' do let(:issues) do entries.map do |entry| @@ -48,13 +45,11 @@ it 'has a colon and a whitespace at the end' do entries_including_issue_link = entries.select do |entry| entry.match(/^\*\s*\[/) end - entries_including_issue_link.each do |entry| - expect(entry).to include('): ') - end + expect(entries_including_issue_link).to all(include('): ')) end end describe 'body' do let(:bodies) do @@ -70,12 +65,10 @@ expect(body).not_to match(/^[a-z]/) end end it 'ends with a punctuation' do - bodies.each do |body| - expect(body).to match(/[\.\!]$/) - end + expect(bodies).to all(match(/[\.\!]$/)) end end end end