运行rspec时隐藏文件列表? [英] Hide the list of files when running rspec?

查看:127
本文介绍了运行rspec时隐藏文件列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在大型Rails项目的命令行上运行 rake spec 时,我会得到一个将运行的每个rspec文件的大列表。

When running rake spec on the command line for a large Rails project, I get a giant list of every rspec file that will be run.

有没有办法隐藏它?

ruby-1.9.3-p448/bin/ruby -S rspec ./spec/acceptance/replicators/activity_replicator_spec.rb ./spec/acceptance/replicators/template_replicator_spec.rb ./spec/authorization_rules/admin_authorization_rules_spec.rb ...

当我运行 rspec (没有rake调用)输出。

When I run just rspec (no rake call) I don't get this console output.

编辑1

使用 phoet 的答案,我试过

RSpec::Core::RakeTask.new(:spec) do |t|
  t.verbose = false
  t.warning = false
  t.rcov = false
end

task :default => :spec

这没有解决问题。

推荐答案

我最后一次这样做,我必须清除 rake任务。

The last time I did this, I had to clear the rake task first.

if defined? RSpec
  task(:spec).clear
  RSpec::Core::RakeTask.new(:spec) do |t|
    t.verbose = false
  end
end

http://singlebrook.com/blog/disable-rspec-verbosity-to-hide-spec-列表

这篇关于运行rspec时隐藏文件列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆