Sha256: 7cdc34fbc5bb19cccf9ecc3073d394a0c5c8e9a23cd05169edc2f77b5c0cba47

Contents?: true

Size: 1.03 KB

Versions: 6

Compression:

Stored size: 1.03 KB

Contents

require 'turnip_formatter/resource/step/failure_result'
require 'turnip_formatter/resource/step/pending_result'

module TurnipFormatter
  module Resource
    module Step
      class Hook
        include ::TurnipFormatter::Resource::Step::FailureResult
        include ::TurnipFormatter::Resource::Step::PendingResult

        attr_reader :example

        #
        # @param  [RSpec::Core::Example]  example
        #
        def initialize(example)
          @example = example
          @exceptions = []
        end

        def status
          case
          when failed?
            :failed
          when pending?
            :pending
          else
            :passed
          end
        end

        def text
          ''
        end

        def line
          -1
        end

        def argument
          nil
        end
      end

      class BeforeHook < Hook
        def keyword
          'BeforeHook'
        end
      end

      class AfterHook < Hook
        def keyword
          'AfterHook'
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
turnip_formatter-0.8.0 lib/turnip_formatter/resource/step/hook.rb
turnip_formatter-0.7.2 lib/turnip_formatter/resource/step/hook.rb
turnip_formatter-0.7.1 lib/turnip_formatter/resource/step/hook.rb
turnip_formatter-0.7.0 lib/turnip_formatter/resource/step/hook.rb
turnip_formatter-0.6.1 lib/turnip_formatter/resource/step/hook.rb
turnip_formatter-0.6.0 lib/turnip_formatter/resource/step/hook.rb