Sha256: a80df563604670c9598895c512d9d854aacf794a13cf17a5af7ac4650af17d48

Contents?: true

Size: 1.61 KB

Versions: 21

Compression:

Stored size: 1.61 KB

Contents

@test_unit @config
Feature:

  The formatter for test coverage can be customized
  with the SimpleCov.formatter setting. There are two
  built-in formatters:
    SimpleCov::Formatter::SimpleFormatter is a simple
    formatter returning a string of all files with
    theirs coverages.
    SimpleCov::Formatter::MultiFormatter is a formatter
    used to call multiple formatters at once.

  Scenario: With SimpleFormatter
    Given SimpleCov for Test/Unit is configured with:
      """
      require 'simplecov'
      SimpleCov.formatter = SimpleCov::Formatter::SimpleFormatter
      SimpleCov.at_exit do
        puts SimpleCov.result.format!
      end
      SimpleCov.start do
        add_group 'Libs', 'lib/faked_project/'
      end
      """

    When I successfully run `bundle exec rake test`
    Then the output should contain "lib/faked_project/meta_magic.rb (coverage: 100.0%)"

  Scenario: With MultiFormatter
    Given SimpleCov for Test/Unit is configured with:
      """
      require 'simplecov'
      SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
        SimpleCov::Formatter::SimpleFormatter,
        Class.new do
          def format(result)
            raise "Unable to format"
          end
        end
      ]

      SimpleCov.at_exit do
        puts SimpleCov.result.format!.join
      end
      SimpleCov.start do
        add_group 'Libs', 'lib/faked_project/'
      end
      """

    When I successfully run `bundle exec rake test`
    Then the output should contain "lib/faked_project/meta_magic.rb (coverage: 100.0%)"
    And the output should match /Formatter [^\s]* failed with RuntimeError: Unable to format/

Version data entries

21 entries across 19 versions & 6 rubygems

Version Path
simplecov-0.8.2 features/config_formatters.feature
simplecov-0.8.1 features/config_formatters.feature
candlepin-api-0.4.0 bundle/ruby/gems/simplecov-0.7.1/features/config_formatters.feature
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/simplecov-0.7.1/features/config_formatters.feature
simplecov-0.8.0.pre2 features/config_formatters.feature
challah-1.0.0 vendor/bundle/gems/simplecov-0.7.1/features/config_formatters.feature
challah-1.0.0.beta3 vendor/bundle/gems/simplecov-0.7.1/features/config_formatters.feature
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/simplecov-0.7.1/features/config_formatters.feature
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/simplecov-0.7.1/features/config_formatters.feature
challah-1.0.0.beta2 vendor/bundle/gems/simplecov-0.7.1/features/config_formatters.feature
challah-1.0.0.beta vendor/bundle/gems/simplecov-0.7.1/features/config_formatters.feature
simplecov-0.8.0.pre features/config_formatters.feature
challah-0.9.1.beta.3 vendor/bundle/gems/simplecov-0.7.1/features/config_formatters.feature
devise_sociable-0.1.0 vendor/bundle/gems/simplecov-0.7.1/features/config_formatters.feature
challah-0.9.1.beta vendor/bundle/gems/simplecov-0.7.1/features/config_formatters.feature
challah-0.9.0 vendor/bundle/gems/simplecov-0.7.1/features/config_formatters.feature
challah-rolls-0.2.0 vendor/bundle/gems/simplecov-0.7.1/features/config_formatters.feature
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/simplecov-0.7.1/features/config_formatters.feature
challah-0.8.3 vendor/bundle/gems/simplecov-0.7.1/features/config_formatters.feature
simplecov-0.7.1 features/config_formatters.feature