Sha256: 666986b882cc88ba2591c381da449a2d8555d4df2711d607d29299492b4b2a83

Contents?: true

Size: 739 Bytes

Versions: 3

Compression:

Stored size: 739 Bytes

Contents

# -*- coding: utf-8 -*-

module TurnipFormatter
  class Step
    attr_reader :name, :docs, :example

    class << self
      def templates
        @templates ||= {}
      end

      def add_template(status, style, &block)
        templates[status] ||= {}
        templates[status][style] = block
      end

      def status
        ''
      end
    end

    #
    # @param  [RSpec::Core::Example]  example
    # @param  [Hash]  description
    #
    def initialize(example, description)
      @example = example
      @name = description[:keyword] + description[:name]
      @docs = { extra_args: description[:extra_args] }
    end

    def attention?
      !status.empty?
    end

    def status
      self.class.status
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
turnip_formatter-0.0.4 lib/turnip_formatter/step.rb
turnip_formatter-0.0.3 lib/turnip_formatter/step.rb
turnip_formatter-0.0.2 lib/turnip_formatter/step.rb