Sha256: 5dab4668ac5af9b30c80ac2599b5457a755a2dcfaa18f7bc89ac0e708c68e83d

Contents?: true

Size: 911 Bytes

Versions: 12

Compression:

Stored size: 911 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 match "example: my example"

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
rspec-core-2.0.0.a6 features-pending/formatters/custom_formatter.feature
rspec-core-2.0.0.a5 features-pending/formatters/custom_formatter.feature
rspec-core-2.0.0.a4 features-pending/formatters/custom_formatter.feature
rspec-core-2.0.0.a3 features-pending/formatters/custom_formatter.feature
rspec-core-2.0.0.a2 features-pending/formatters/custom_formatter.feature
rspec-core-2.0.0.a1 features-pending/formatters/custom_formatter.feature
rspec-1.2.7 features/formatters/custom_formatter.feature
rspec-1.2.8 features/formatters/custom_formatter.feature
rspec-1.2.5 features/formatters/custom_formatter.feature
rspec-1.2.6 features/formatters/custom_formatter.feature
rspec-1.2.4 features/formatters/custom_formatter.feature
rspec-1.2.3 features/formatters/custom_formatter.feature