Guard warning "warning: loading in progress, circular require considered harmful"

2.5k views Asked by At

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

1

There are 1 answers

5
B.G. On BEST ANSWER

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