Sha256: 94c1fb758d267e9be1e85002b3da28079252a1fede29297202b017e99ac0a554

Contents?: true

Size: 817 Bytes

Versions: 2

Compression:

Stored size: 817 Bytes

Contents

module TurnipFormatter
  module StepTemplate
    class Base
      class << self
        def inherited(child)
          TurnipFormatter.step_templates << child.new
        end

        def on_passed(template)
          hooks[:passed] << template
        end

        def on_failed(template)
          hooks[:failed] << template
        end

        def on_pending(template)
          hooks[:pending] << template
        end

        def hooks
          @hooks ||= { passed: [], failed: [], pending: [] }
        end

        #
        # Return SCSS string that be used in this class
        #
        def css
          ''
        end
      end

      def formatted_backtrace(example, exception = nil)
        RSpec::Core::Formatters::TurnipFormatter.formatted_backtrace(example, exception)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
turnip_formatter-0.6.0.pre.beta.6 lib/turnip_formatter/step_template/base.rb
turnip_formatter-0.6.0.pre.beta.5 lib/turnip_formatter/step_template/base.rb