Sha256: ada081b590b996d3ea194cd9bb7409b8f7cbbea0d4e966282e710f3d5ca74b5c

Contents?: true

Size: 833 Bytes

Versions: 11

Compression:

Stored size: 833 Bytes

Contents

require "konacha/reporter/metadata"

# The Example class mimics the public interface of RSpec::Core::Example.

module Konacha
  class Reporter
    class Example
      attr_reader :metadata, :parent

      def initialize(data, parent)
        @metadata = Metadata.new(data)
        @parent = parent
      end

      delegate :full_description, :description, :location, :file_path, :line_number, :pending, :pending_message, :exception, :execution_result, :to => :metadata

      alias_method :pending?, :pending
      alias_method :options, :metadata
      alias_method :example_group, :parent

      def passed?
        execution_result[:status] == "passed"
      end

      def failed?
        execution_result[:status] == "failed"
      end

      def update_metadata(data)
        metadata.update(data)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
konacha-3.0.0 lib/konacha/reporter/example.rb
konacha-2.7.0 lib/konacha/reporter/example.rb
konacha-2.6.0 lib/konacha/reporter/example.rb
konacha-2.5.1 lib/konacha/reporter/example.rb
konacha-2.5.0 lib/konacha/reporter/example.rb
konacha-2.4.0 lib/konacha/reporter/example.rb
konacha-2.3.0 lib/konacha/reporter/example.rb
konacha-2.2.0 lib/konacha/reporter/example.rb
konacha-2.1.0 lib/konacha/reporter/example.rb
konacha-2.0.0 lib/konacha/reporter/example.rb
konacha-2.0.0.beta3 lib/konacha/reporter/example.rb