Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.0k views
in Technique[技术] by (71.8m points)

ruby on rails 3 - Hide the list of files when running 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.

Is there a way to hide that by default?

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 ...

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


EDIT 1

Working from phoet's answer, I tried

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

task :default => :spec

This did not solve the issue.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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-list


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...