Sha256: 87dfa5b122dc25cfa30d2d415dc7b970a2ab86c88b064c3dfd553ebfdb45ba3b

Contents?: true

Size: 803 Bytes

Versions: 11

Compression:

Stored size: 803 Bytes

Contents

require "konacha/reporter/metadata"

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

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

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

      delegate :full_description, :description, :file_path, :described_class, :to => :metadata

      alias_method :display_name, :description

      def parent_groups
        ancestor = parent
        groups = []
        while ancestor
          groups << ancestor
          ancestor = ancestor.parent
        end

        groups
      end

      alias_method :ancestors, :parent_groups

      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_group.rb
konacha-2.7.0 lib/konacha/reporter/example_group.rb
konacha-2.6.0 lib/konacha/reporter/example_group.rb
konacha-2.5.1 lib/konacha/reporter/example_group.rb
konacha-2.5.0 lib/konacha/reporter/example_group.rb
konacha-2.4.0 lib/konacha/reporter/example_group.rb
konacha-2.3.0 lib/konacha/reporter/example_group.rb
konacha-2.2.0 lib/konacha/reporter/example_group.rb
konacha-2.1.0 lib/konacha/reporter/example_group.rb
konacha-2.0.0 lib/konacha/reporter/example_group.rb
konacha-2.0.0.beta3 lib/konacha/reporter/example_group.rb