Enable warnings when running tests

This PR enables rake's test task to opt into running the test suite with
warnings, this is to avoid warnings sneaking into the library.

Illustrative example:

```
% git diff
diff --git a/lib/zeitwerk.rb b/lib/zeitwerk.rb
index a1335d1..615d516 100644
--- a/lib/zeitwerk.rb
+++ b/lib/zeitwerk.rb
@@ -16,6 +16,7 @@ module Zeitwerk
   # @experimental
   # @sig () -> void
   def self.with_loader
+    a = 1
     loader = Zeitwerk::Loader.new
     yield loader
   ensure
% bundle exec rake
/Users/teo/src/github.com/fxn/zeitwerk/lib/zeitwerk.rb:19: warning: assigned but unused variable - a
... output omitted ...
```
This commit is contained in:
Teo Ljungberg 2022-02-14 15:02:51 +01:00
parent 11600bc7ff
commit a4d99c0ed8
1 changed files with 1 additions and 0 deletions

View File

@ -7,4 +7,5 @@ task :default => :test
Rake::TestTask.new do |t|
t.test_files = Dir.glob('test/lib/**/test_*.rb')
t.libs << "test"
t.warning = true
end