Reducing the rake spec verbosity

Each time I run the "rake spec" in my Rails 3 / RSpec 2 project, the first thing it does is print the command "bundle exec spec ....". However, the part that I skipped is a list of all the specification files in the project, which is a large piece of text that interferes with reading the test results. How to disable this?

+4
source share
3 answers

I do not use the rake specification, and instead I run my specifications through the rspec runner. So instead of "rake spec" I just do "rspec spec /". You can pass various parameters to this command, as described in the first answer to your question.

+1
source

You can change the output of your specifications by placing flags in the spec/spec.opts in your rails application.

Example from this blog post:

 --colour --format progress --format specdoc:spec/spec_full_report.txt --format failing_examples:spec/spec_failing_examples.txt --format html:spec/spec_report.html --loadby mtime --reverse 

Here you can see all the options available: https://github.com/dchelimsky/rspec/blob/master/lib/spec/runner/option_parser.rb

+2
source

Just add this to your rakefile

 require 'rspec/core/rake_task' task(:spec).clear RSpec::Core::RakeTask.new(:spec) do |t| t.verbose = false end 
+1
source

All Articles