Fix "@disable_warnings" spec warning (#416)

When running rspec specs on the ruby-grape project with warnings enabled
this warning is printed hundreds of times.

This change fixes the warning.

Also, turn on warnings when running rspec to see when this happens.
This commit is contained in:
Alexandre Filipe Campos 2017-03-01 12:13:50 +00:00 committed by Michael Herold
parent 846ce0de72
commit 9f965feb37
3 changed files with 3 additions and 1 deletions

View File

@ -36,6 +36,7 @@ scheme are considered to be bugs.
### Miscellaneous
* [#416](https://github.com/intridea/hashie/pull/416): Fix `warning: instance variable @disable_warnings not initialized` - [@axfcampos](https://github.com/axfcampos).
* Your contribution here.
## [3.5.5] - 2017-02-24

View File

@ -83,7 +83,7 @@ module Hashie
# @api semipublic
# @return [Boolean]
def self.disable_warnings?
!!@disable_warnings
@disable_warnings ||= false
end
# Inheritance hook that sets class configuration when inherited.

View File

@ -19,4 +19,5 @@ RSpec.configure do |config|
config.expect_with :rspec do |expect|
expect.syntax = :expect
end
config.warnings = true
end