File: changelog_test.rb

package info (click to toggle)
ruby-inherited-resources 1.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 824 kB
  • sloc: ruby: 4,388; makefile: 6
file content (24 lines) | stat: -rw-r--r-- 608 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'test_helper'

class ChangelogTest < ActiveSupport::TestCase
  def setup
    path = File.join(File.dirname(__dir__), "CHANGELOG.md")
    @changelog = File.read(path)
  end

  def test_has_definitions_for_all_implicit_links
    implicit_link_names = @changelog.scan(/\[([^\]]+)\]\[\]/).flatten.uniq
    implicit_link_names.each do |name|
      assert_includes @changelog, "[#{name}]: https"
    end
  end

  def test_entry_does_end_with_a_punctuation
    lines = @changelog.each_line
    entries = lines.grep(/^\*/)

    entries.each do |entry|
      assert_match(/(\.|\:)$/, entry)
    end
  end
end