3

I have a simple Ruby test envinvorment set up with: minitest, guard, guard-minitest, and terminal-notifier-guard.

I'm using the following Rakefile so my tests are run by default because that's what Travis CI does by default.

require 'rake/testtask'
task :default => [:test]
Rake::TestTask.new do |t|
  t.libs << 'test'
  t.pattern = "test/test_*"
end

The tests do run and pass but I get multiple screens worth of warnings. I found an answer and another answer.

But it seems like those solutions are specific to rails and rspec.

Why am I getting these warnings?

You can find the full project on GitHub and the full error output in this gist

Community
  • 1
  • 1
mbigras
  • 7,664
  • 11
  • 50
  • 111

1 Answers1

6

If you just want to turn off the warnings, you can do so in the rake test task setup:

require 'rake/testtask'
task :default => [:test]
Rake::TestTask.new do |t|
  t.libs << 'test'
  t.pattern = "test/test_*"
  t.warning = false
end
Doktor OSwaldo
  • 5,732
  • 20
  • 41
  • 2
    I believe the question was "Why am I getting these warnings?" this does not answer that. – hoff2 Jul 30 '20 at 19:16
  • @hoff2 the error says it all, there are circular requires. But since they are often in gems, turning it off is the only way to get rid of them. – Doktor OSwaldo Jul 31 '20 at 05:38