Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/y-yagi/minitest-warning
https://github.com/y-yagi/minitest-warning
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/y-yagi/minitest-warning
- Owner: y-yagi
- License: mit
- Created: 2018-11-29T08:07:43.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-30T00:20:01.000Z (almost 6 years ago)
- Last Synced: 2024-04-09T21:48:17.092Z (7 months ago)
- Language: Ruby
- Size: 9.77 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Minitest::Warning
Show the number of Ruby warnings, and sets it to fail if there is a warning.
[![Build Status](https://travis-ci.org/y-yagi/minitest-warning.svg?branch=master)](https://travis-ci.org/y-yagi/minitest-warning)
[![Gem Version](https://badge.fury.io/rb/minitest-warning.svg)](http://badge.fury.io/rb/minitest-warning)## Installation
Add this line to your application's Gemfile:
```ruby
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:
```ruby
require 'minitest/warning'
Minitest::Warning.enable!
``````bash
$ ./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:
```ruby
Minitest::Warning.enable!(
path: "activejob-cancel" # Only warnings matching path are targeted. The default is nil.
)
```