Sha256: 4e429189dfa22fca6108e43f799e988b6c4e4f4ccc21de5e4d08c4fd69fd0fc1

Contents?: true

Size: 919 Bytes

Versions: 3

Compression:

Stored size: 919 Bytes

Contents

Feature: custom formatters

  In order to format output/reporting to my particular needs
  As an RSpec user
  I want to create my own custom output formatters

  Scenario: specdoc format
    Given a file named "custom_formatter.rb" with:
      """
      require 'spec/runner/formatter/base_formatter'
      class CustomFormatter < Spec::Runner::Formatter::BaseFormatter
        def initialize(options, output)
          @output = output
        end
        def example_started(proxy)
          @output << "example: " << proxy.description
        end
      end
      """
    And a file named "simple_example_spec.rb" with:
      """
      describe "my group" do
        specify "my example" do
        end
      end
      """

    When I run "spec simple_example_spec.rb --require ./custom_formatter.rb --format CustomFormatter"
    Then the exit code should be 0
    And the stdout should include "example: my example"

Version data entries

3 entries across 3 versions & 3 rubygems

Version Path
rspec-instructure-1.3.3 features/formatters/custom_formatter.feature
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-1.3.2/features/formatters/custom_formatter.feature
rspec-1.3.2 features/formatters/custom_formatter.feature