Skip to content
Code style checking for Minitest files.
Ruby Shell
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Create the basic project structure Aug 7, 2019
.github Add a FUNDING.yml Oct 5, 2019
bin Apply `rubocop -a` Aug 7, 2019
config Arrange cop names in default configuration file in ASCII order Oct 20, 2019
lib
manual
relnotes Add release task and release notes Oct 13, 2019
tasks Add release task and release notes Oct 13, 2019
test Add new cop Minitest/AssertEqual (#31) Oct 16, 2019
.gitignore Create the basic project structure Aug 7, 2019
.rubocop.yml Include a Cop to enforce assert_nil over assert_equal(nil) Aug 30, 2019
.rubocop_todo.yml Apply `rubocop --auto-gen-config` Aug 7, 2019
CHANGELOG.md [Fix #25] Add `Enabled: true` to `Minitest` department config Oct 18, 2019
CONTRIBUTING.md
Gemfile Add release task and release notes Oct 13, 2019
LICENSE.txt Update authors Aug 5, 2019
README.md Improve the README Oct 16, 2019
Rakefile Include a Cop to enforce assert_nil over assert_equal(nil) Aug 30, 2019
mkdocs.yml Fix a typo Sep 7, 2019
readthedocs.yml Add readthedocs.yml Sep 7, 2019
rubocop-minitest.gemspec Update metadata for gemspec Sep 7, 2019

README.md

RuboCop Minitest

Gem Version CircleCI

A RuboCop extension focused on enforcing Minitest best practices and coding conventions. The library is based on the guidelines outlined in the community Minitest Style Guide.

Installation

Just install the rubocop-minitest gem

gem install rubocop-minitest

or if you use bundler put this in your Gemfile

gem 'rubocop-minitest'

Usage

You need to tell RuboCop to load the Minitest extension. There are three ways to do this:

RuboCop configuration file

Put this into your .rubocop.yml.

require: rubocop-minitest

Alternatively, use the following array notation when specifying multiple extensions.

require:
  - rubocop-other-extension
  - rubocop-minitest

Now you can run rubocop and it will automatically load the RuboCop Minitest cops together with the standard cops.

Command line

rubocop --require rubocop-minitest

Rake task

RuboCop::RakeTask.new do |task|
  task.requires << 'rubocop-minitest'
end

The Cops

All cops are located under lib/rubocop/cop/minitest, and contain examples/documentation. The documentation is published here.

In your .rubocop.yml, you may treat the Minitest cops just like any other cop. For example:

Minitest/AssertNil:
  Exclude:
    - test/my_file_to_ignore_test.rb

Contributing

Checkout the contribution guidelines.

License

rubocop-minitest is MIT licensed. See the accompanying file for the full text.

You can’t perform that action at this time.