如何解决如何抑制RSpec的故障输出?
输出分为3个部分:
Failures:
1) Spec name
Failure/Error: return ActiveRecord::Base.connection.exec_query(query_string) if Rails.env.test?
ActiveRecord::StatementInvalid:
PG::UndefinedFunction: ERROR: function group_concat(character varying,unknown) does not exist
LINE 1: SELECT ...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
# ./app/models/...
# ./app/models/...
# ./app/models/...
# ------------------
# --- Caused by: ---
# PG::UndefinedFunction:
# ERROR: function group_concat(character varying,unknown) does not exist
# LINE 1: SELECT ... as...
# ^
# HINT: No function matches the given name and argument types. You might need to add explicit type casts.
# ./app/models/....rb:7:in `query'
Finished in 15.8 seconds (files took 12.76 seconds to load)
69 examples,11 failures
Failed examples:
rspec ./spec/models/foo_spec.rb:385 # ...
rspec ./spec/models/foo_spec.rb:385 # ...
rspec ./spec/models/foo_spec.rb:385 # ...
故障很多,我对故障总数更感兴趣。
如何将输出限制为:
Finished in 15.8 seconds (files took 12.76 seconds to load)
69 examples,11 failures
解决方法
不是我一直在寻找的答案,但这很好用:
rspec | grep examples
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。