Skip to content

Commit

Permalink
Add minitest-proveit to development
Browse files Browse the repository at this point in the history
This commit adds minitest-proveit to development and resolve the following errors:

```console
% bundle exec rake
(snip)

1) Failure:
ProjectTest#test_feature_entry_has_a_link_to_the_contributors_at_the_end
[/Users/koic/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/minitest-5.17.0/lib/minitest/test.rb:107]:
Absence of failure is not success. Prove it!

2) Failure:
ProjectTest#test_has_a_single_line
[/Users/koic/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/minitest-5.17.0/lib/minitest/test.rb:107]:
Absence of failure is not success. Prove it!

3) Failure:
ProjectTest#test_feature_entry_has_a_link_to_the_issue_or_pull_request_address_at_the_beginning
[/Users/koic/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/minitest-5.17.0/lib/minitest/test.rb:107]:
Absence of failure is not success. Prove it!

4) Failure:
ProjectTest#test_feature_entry_starts_with_new_fix_or_change
[/Users/koic/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/minitest-5.17.0/lib/minitest/test.rb:107]:
Absence of failure is not success. Prove it!

2220 runs, 6398 assertions, 4 failures, 0 errors, 0 skips
rake aborted!
```
  • Loading branch information
koic committed Jan 31, 2023
1 parent d01776b commit 2febba4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gemspec

gem 'bump', require: false
gem 'minitest-proveit'
gem 'rake'
gem 'rubocop', github: 'rubocop/rubocop'
gem 'rubocop-performance', '~> 1.15.0'
Expand Down
8 changes: 8 additions & 0 deletions test/project_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ def test_body_ends_with_a_punctuation
end

def test_feature_entry_has_a_link_to_the_issue_or_pull_request_address_at_the_beginning
skip if @feature_entries.empty?

repo = 'rubocop/rubocop-minitest'
address_pattern = %r{\A\* \[#\d+\]\(https://github\.com/#{repo}/(issues|pull)/\d+\):}

Expand All @@ -100,18 +102,24 @@ def test_feature_entry_has_a_link_to_the_issue_or_pull_request_address_at_the_be
end

def test_feature_entry_has_a_link_to_the_contributors_at_the_end
skip if @feature_entries.empty?

@feature_entries.each do |path|
assert_match(/\(\[@\S+\]\[\](?:, \[@\S+\]\[\])*\)$/, File.read(path))
end
end

def test_feature_entry_starts_with_new_fix_or_change
skip if @feature_entries.empty?

@feature_entries.each do |path|
assert_match(/\A(new|fix|change)_.+/, File.basename(path))
end
end

def test_has_a_single_line
skip if @feature_entries.empty?

@feature_entries.each do |path|
assert_equal(1, File.foreach(path).count)
end
Expand Down
5 changes: 5 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@

# Require supporting files exposed for testing.
require 'rubocop/minitest/support'
require 'minitest/proveit'

Minitest::Test.class_eval do
prove_it!
end

0 comments on commit 2febba4

Please sign in to comment.