Sha256: b9434b730e1e00caed0c1f919cc4cd0b6b47e0b6d54c9dcaeee99f9ce3fcf83b

Contents?: true

Size: 917 Bytes

Versions: 29

Compression:

Stored size: 917 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

29 entries across 29 versions & 9 rubygems

Version Path
rspec-1.3.1 features/formatters/custom_formatter.feature
rspec-1.3.1.rc features/formatters/custom_formatter.feature
rspec-1.3.0 features/formatters/custom_formatter.feature
hubbub-0.0.11 lib/vendor/plugins/rspec/features/formatters/custom_formatter.feature
hubbub-0.0.10 lib/vendor/plugins/rspec/features/formatters/custom_formatter.feature
hubbub-0.0.9 lib/vendor/plugins/rspec/features/formatters/custom_formatter.feature
hubbub-0.0.8 lib/vendor/plugins/rspec/features/formatters/custom_formatter.feature
hubbub-0.0.6 lib/vendor/plugins/rspec/features/formatters/custom_formatter.feature
simple-templater-0.0.1.4 gems/gems/rspec-1.2.9/features/formatters/custom_formatter.feature
media-path-0.1.2 vendor/rspec/features/formatters/custom_formatter.feature
simple-templater-0.0.1.3 vendor/rspec/features/formatters/custom_formatter.feature
pupu-0.0.2.pre vendor/rspec/features/formatters/custom_formatter.feature
media-path-0.1.1.pre vendor/rspec/features/formatters/custom_formatter.feature
simple-templater-0.0.1.2 vendor/rspec/features/formatters/custom_formatter.feature
media-path-0.1.1 vendor/rspec/features/formatters/custom_formatter.feature
simple-templater-0.0.1.1 vendor/rspec/features/formatters/custom_formatter.feature
pupu-0.0.2 vendor/rspec/features/formatters/custom_formatter.feature
rango-0.0.6 vendor/rspec/features/formatters/custom_formatter.feature
rango-0.1.pre vendor/rspec/features/formatters/custom_formatter.feature
pupu-0.0.1 vendor/rspec/features/formatters/custom_formatter.feature