Sha256: 161d5cb00f9a91b16158435c100a4d6c5354ce3ad9c95399b8a2f4c4594eafd4

Contents?: true

Size: 721 Bytes

Versions: 1

Compression:

Stored size: 721 Bytes

Contents

require 'turnip_formatter/scenario/base'

module TurnipFormatter
  module Scenario
    class Pending < Base
      def steps
        steps = super
        steps[@offending_line].status = :pending
        steps[(@offending_line + 1)..-1].each do |step|
          step.status = :unexecuted
        end
        steps
      end

      protected

        def validation
          if pending_message =~ /^No such step\((?<stepno>\d+)\): /
            @offending_line = $~[:stepno].to_i
          else
            @errors << 'has no pending step information'
          end

          super
        end

      private

        def pending_message
          example.execution_result[:pending_message]
        end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
turnip_formatter-0.3.0 lib/turnip_formatter/scenario/pending.rb