Sha256: 11941a0f7f81dad5b60f0e93982879c52bcb6eb0e2b698070ec6ce7a385ae14b

Contents?: true

Size: 860 Bytes

Versions: 24

Compression:

Stored size: 860 Bytes

Contents

require 'rspec/core/formatters/base_formatter'

class OrigenFormatter < RSpec::Core::Formatters::BaseFormatter
  rspec_version = RSpec.constants.include?(:Version) ? RSpec::Version::STRING : RSpec::Core::Version::STRING 
  if Gem::Version.new(rspec_version) < Gem::Version.new('3.0.0')
    # legacy formatter
    def dump_summary(duration, example_count, failure_count, pending_count)
      if failure_count > 0
        Origen.app.stats.report_fail
      else
        Origen.app.stats.report_pass
      end
      super(duration, example_count, failure_count, pending_count)
    end
  else
    # RSpec 3 API
    RSpec::Core::Formatters.register self, :dump_summary
    def dump_summary(summary)
      puts
      if summary.failed_examples.size > 0
        Origen.app.stats.report_fail
      else
        Origen.app.stats.report_pass
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
origen-0.60.18 spec/format/origen_formatter.rb
origen-0.60.17 spec/format/origen_formatter.rb
origen-0.60.16 spec/format/origen_formatter.rb
origen-0.60.14 spec/format/origen_formatter.rb
origen-0.60.13 spec/format/origen_formatter.rb
origen-0.60.12 spec/format/origen_formatter.rb
origen-0.60.11 spec/format/origen_formatter.rb
origen-0.60.10 spec/format/origen_formatter.rb
origen-0.60.9 spec/format/origen_formatter.rb
origen-0.60.8 spec/format/origen_formatter.rb
origen-0.60.7 spec/format/origen_formatter.rb
origen-0.60.6 spec/format/origen_formatter.rb
origen-0.60.5 spec/format/origen_formatter.rb
origen-0.60.4 spec/format/origen_formatter.rb
origen-0.60.3 spec/format/origen_formatter.rb
origen-0.60.2 spec/format/origen_formatter.rb
origen-0.60.1 spec/format/origen_formatter.rb
origen-0.60.0 spec/format/origen_formatter.rb
origen-0.59.8 spec/format/origen_formatter.rb
origen-0.59.7 spec/format/origen_formatter.rb