Sha256: 17ca34764b3aaf514d9c0d241a33cef3c37a6f1fd0a77ff6ab953a69f20a5831

Contents?: true

Size: 789 Bytes

Versions: 9

Compression:

Stored size: 789 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)
        RSpec::Core::Formatters::TurnipFormatter.formatted_backtrace(example)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
turnip_formatter-0.6.0.pre.beta.4 lib/turnip_formatter/step_template/base.rb
turnip_formatter-0.6.0.pre.beta.3 lib/turnip_formatter/step_template/base.rb
turnip_formatter-0.6.0.pre.beta.2 lib/turnip_formatter/step_template/base.rb
turnip_formatter-0.6.0.pre.beta.1 lib/turnip_formatter/step_template/base.rb
turnip_formatter-0.5.0 lib/turnip_formatter/step_template/base.rb
turnip_formatter-0.4.0 lib/turnip_formatter/step_template/base.rb
turnip_formatter-0.3.4 lib/turnip_formatter/step_template/base.rb
turnip_formatter-0.3.3 lib/turnip_formatter/step_template/base.rb
turnip_formatter-0.3.2 lib/turnip_formatter/step_template/base.rb