No commit activity in last 3 years
No release in over 3 years
Detect Ruby warnings.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

 Project Readme

Minitest::Warning

Show the number of Ruby warnings, and sets it to fail if there is a warning.

Build Status Gem Version

Installation

Add this line to your application's Gemfile:

gem 'minitest-warning'

And then execute:

$ bundle

Or install it yourself as:

$ gem install minitest-warning

Usage

In your test_helper.rb file, add the following lines:

require 'minitest/warning'
Minitest::Warning.enable!
$ ./bin/rails test
test/models/user_test.rb:5: warning: assigned but unused variable - a
Run options: --seed 33687

# Running:

........

Finished in 0.672513s, 11.8957 runs/s, 17.8435 assertions/s.

8 runs, 12 assertions, 0 failures, 0 errors, 0 skips, 1 warnings
$ echo $?
1

Options can be specified to enable! method. Can specify options are as follows:

Minitest::Warning.enable!(
  path: "activejob-cancel"  # Only warnings matching path are targeted. The default is nil.
)