mercredi 1 juin 2016

Annoying Guard notification when testing

Recently I made a simple ruby application and have been using minitest to test it.

Following the advice of the Head First Ruby book, I automated this testing using Rake(I'll write what it told me to put in the Rakefile at the end of this post, in case that helps). The test seems to run fine (everything passes in a way I would expect it to), but I always get this notification at the end of it all:

rvm/gems/ruby-2.3.0/gems/guard-2.14.0/lib/guard/notifier.rb:28: warning: instance variable @notifier not initialized

Testing things manually by telling ruby to include which files I want, does not have this issue, only when I use "rake test" to test things.

As far as I can tell, this is related to when I set up Guard when I was following Michael Hartl's Rails Tutorial, at the end of chapter 3. I followed the directions for setting that up (correctly, as far as I can tell), and this was all in a completely different folder(ultimately my ruby and rails projects do have the same parent folder that they sit in, but are themselves in completely separate ruby_projects and rails_projects folders). If possible, I would like to stop this notification on my ruby application that I am testing. Is there a good way to do this?

Contents of the Rakefile I am using, if that helps: require "rake/testtask"

  Rake::TestTask.new(:test) do |t|
  t.libs << "lib"
  t.test_files=FileList['test/**/test_*.rb']
end

My test file requires minitest/autorun, and the file for the application that I am testing, then has the normal tests

Aucun commentaire:

Enregistrer un commentaire