Ruby Forum RSpec > Hiding the passes

Posted by Oliver Saunders (ole)
on 08.05.2008 01:18
How do you hide all the green passing examples from the output?
I don't need to know what has passed and it means I have to scroll to
see what has failed.
Posted by Steve Downey (Guest)
on 08.05.2008 02:14
(Received via mailing list)
I assume you are running with '-f s' switch?  Maybe its in your 
spec.opts
file ... maybe as --format progress?

If you change that to '-f p' you only see progress as a single '.' for 
each
passing test with errors at the end of the output.

Or maybe I'm not understanding the question.

On Wed, May 7, 2008 at 4:18 PM, Oliver Saunders <lists@ruby-forum.com>
Posted by Pat Maddox (pergesu)
on 08.05.2008 03:04
(Received via mailing list)
On Wed, May 7, 2008 at 4:18 PM, Oliver Saunders <lists@ruby-forum.com> 
wrote:
> How do you hide all the green passing examples from the output?
>  I don't need to know what has passed and it means I have to scroll to
>  see what has failed.

Hey Oliver,

You can write a custom formatter that implements #example_passed as a 
noop:

class HalfEmptyFormatter < Spec::Runner::Formatter::ProgressBarFormatter
  def example_passed; end
end
Posted by Ben Mabey (mabes)
on 08.05.2008 04:03
(Received via mailing list)
Steve Downey wrote:
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
I wrote some JS that would hide the passing specs on the HTML formatted
version and would allow you to expand it later.  I might be able to dig
it up if your interested...

-Ben
Posted by Oliver Saunders (ole)
on 08.05.2008 20:40
I should explain I'm running the tests from textmate.
So for those interested in doing the same I changed the "Run Examples" 
command in the RSpec bundle to:

#!/usr/bin/env ruby
require ENV['TM_BUNDLE_SUPPORT'] + "/lib/spec/mate"
require 'spec/runner/formatter/html_formatter'

module Spec::Runner::Formatter
    class TextMateFormatter < HtmlFormatter
     # hide passes
        def example_passed(*args); end
    end
end

Spec::Mate::Runner.new.run_file STDOUT