Sha256: 2c3ffd4d2fb405f944934c88cd31b473c5d95444506a839947552291ff05621d

Contents?: true

Size: 800 Bytes

Versions: 4

Compression:

Stored size: 800 Bytes

Contents

require 'turnip_formatter/scenario/base'

module TurnipFormatter
  module Scenario
    class Pending < Base
      def steps
        steps = super
        return steps unless pending_line_number

        steps.each do |step|
          case
          when step.line == pending_line_number
            step.status = :pending
          when step.line > pending_line_number
            step.status = :unexecuted
          end
        end

        steps
      end

      protected

      def validation
        @errors << 'has no pending step information' unless pending_line_number
        super
      end

      private

      def pending_line_number
        example.metadata[:line_number]
      end

      def pending_message
        example.execution_result.pending_message
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
turnip_formatter-0.6.0.pre.beta.2 lib/turnip_formatter/scenario/pending.rb
turnip_formatter-0.6.0.pre.beta.1 lib/turnip_formatter/scenario/pending.rb
turnip_formatter-0.5.0 lib/turnip_formatter/scenario/pending.rb
turnip_formatter-0.4.0 lib/turnip_formatter/scenario/pending.rb