Skip to content

Instantly share code, notes, and snippets.

@jaredbeck
Created July 20, 2012 02:51
Show Gist options
  • Select an option

  • Save jaredbeck/3148368 to your computer and use it in GitHub Desktop.

Select an option

Save jaredbeck/3148368 to your computer and use it in GitHub Desktop.
Disable rspec verbosity
# Turn off rspec verbosity, so that the
# resultant rspec command, and all the
# spec names, are not echoed to stdout.
# See http://bit.ly/MoOoB3 -Jared 2012-07-19
if defined? RSpec
task(:spec).clear
RSpec::Core::RakeTask.new(:spec) do |t|
t.verbose = false
end
end
@haxney

haxney commented Feb 6, 2014

Copy link
Copy Markdown

This has a critical flaw: any dependencies of the task are lost when it is cleared. To preserve the dependencies (such as setting up the DB in Rails), use:

if defined? RSpec
  prereqs = Rake::Task[:spec].prerequisites
  task(:spec).clear
  RSpec::Core::RakeTask.new(:spec => prereqs) do |t|
    t.verbose = false
  end
end

@jaredbeck

Copy link
Copy Markdown
Author

To preserve the dependencies ...

Thanks Daniel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment