Michael Hartl第3.3.1章Rails测试错误消息

时间:2017-05-12 04:51:15

标签: ruby-on-rails-5

我已经逐字逐句地遵循了教程,并且我正在使用Cloud9平台。 我应该跑:$ rails test
我应该得到:2次测试,2次断言,0次失败,0次错误,0次跳过

由于我使用Cloud9,我不确定我是否运行了错误的命令,但是当我运行该程序时,页面有效,这意味着我不应该收到任何错误一点都不这几乎就好像测试从未运行过一样。有什么想法吗?

输入代码他(static-pages)$ rails test 在过程5822中通过Spring预加载器运行 运行选项: - seed 31158

运行:

...

完成0.554944s,5.4060次/秒,5.4060次断言/秒。 /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.1/lib/rails/test_unit/minitest_plugin.rb:9:in aggregated_results': wrong number of arguments (given 1, expected 0) (ArgumentError) from /usr/local/rvm/gems/ruby-2.3.0/gems/minitest-5.10.2/lib/minitest.rb:597:in报告&#39;         来自/usr/local/rvm/gems/ruby-2.3.0/gems/minitest-reporters-1.1.9/lib/minitest/minitest_reporter_plugin.rb:26:in each' from /usr/local/rvm/gems/ruby-2.3.0/gems/minitest-reporters-1.1.9/lib/minitest/minitest_reporter_plugin.rb:26:in报告&#39;         来自/usr/local/rvm/gems/ruby-2.3.0/gems/minitest-5.10.2/lib/minitest.rb:687:in each' from /usr/local/rvm/gems/ruby-2.3.0/gems/minitest-5.10.2/lib/minitest.rb:687:in报告&#39;         来自/usr/local/rvm/gems/ruby-2.3.0/gems/minitest-5.10.2/lib/minitest.rb:141:in run' from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.1/lib/rails/test_unit/minitest_plugin.rb:73:in运行&#39;         来自/usr/local/rvm/gems/ruby-2.3.0/gems/minitest-5.10.2/lib/minitest.rb:63:in block in autorun' from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:161:in fork&#39;         来自/usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:161:in serve' from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:131:in阻止运行&#39;         来自/usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:125:in loop' from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:125:in运行&#39;         来自/usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application/boot.rb:19:in <top (required)>' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in要求&#39;         来自/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from -e:1:in&#39; re

1 个答案:

答案 0 :(得分:0)

Ugg刚刚发现这个问题已在其他地方得到解答 显然,Minitest Gem文件中存在一个错误。

我将以下代码添加到test / test_helper.rb文件中以解决它。但是,我非常确定还有其他方法可以解决它。

MINITEST :: Reporters.use!