Hiding the passes

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.

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 S. [email protected]

On Wed, May 7, 2008 at 4:18 PM, Oliver S. [email protected]
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

Steve D. wrote:



rspec-users mailing list
[email protected]
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

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs