Sha256: 3f39ce655687f1409ecda5414f54e4cf8d2259ac616f3dcb0db7b64c8d318bff

Contents?: true

Size: 597 Bytes

Versions: 50

Compression:

Stored size: 597 Bytes

Contents

# This is an example of how you can use a custom formatter to do custom
# reporting. This formatter will only report example groups and examples that
# have :report => true (or anything truthy) in the declaration. See
# options_example.rb in this directory.  

require 'spec/runner/formatter/base_text_formatter'

class OptionsFormatter < Spec::Runner::Formatter::BaseTextFormatter
  def example_started(proxy)
    if proxy.options[:report]
      puts proxy.description
    end
  end

  def example_group_started(proxy)
    if proxy.options[:report]
      puts proxy.description
    end
  end
end

Version data entries

50 entries across 50 versions & 11 rubygems

Version Path
rspec-instructure-1.3.3 examples/passing/options_formatter.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-1.3.2/examples/passing/options_formatter.rb
rspec-1.3.2 examples/passing/options_formatter.rb
rspec-1.3.1 examples/passing/options_formatter.rb
rspec-1.3.1.rc examples/passing/options_formatter.rb
rspec-core-2.0.0.beta.9 example_specs/passing/options_formatter.rb
rspec-core-2.0.0.beta.8 example_specs/passing/options_formatter.rb
rspec-core-2.0.0.beta.7 example_specs/passing/options_formatter.rb
rspec-core-2.0.0.beta.6 example_specs/passing/options_formatter.rb
rspec-core-2.0.0.beta.5 example_specs/passing/options_formatter.rb
rspec-core-2.0.0.beta.4 example_specs/passing/options_formatter.rb
rspec-core-2.0.0.beta.3 example_specs/passing/options_formatter.rb
rspec-core-2.0.0.beta.2 example_specs/passing/options_formatter.rb
rspec-core-2.0.0.beta.1 example_specs/passing/options_formatter.rb
rspec-core-2.0.0.a10 example_specs/passing/options_formatter.rb
rspec-core-2.0.0.a9 example_specs/passing/options_formatter.rb
rspec-core-2.0.0.a8 example_specs/passing/options_formatter.rb
rspec-core-2.0.0.a7 example_specs/passing/options_formatter.rb
rspec-core-2.0.0.a6 example_specs/passing/options_formatter.rb
rspec-core-2.0.0.a5 example_specs/passing/options_formatter.rb