Sha256: 45a5ea743d5052c31a39a67376b73cbb60d93912f0f8ef1786e602b7feed0ad9

Contents?: true

Size: 673 Bytes

Versions: 4

Compression:

Stored size: 673 Bytes

Contents

# frozen_string_literal: true

module Cucumber
  module Formatter
    class HookQueryVisitor
      attr_reader :type

      def initialize(test_step)
        @hook = false
        @type = :no_hook
        test_step.source.last.describe_to(self)
      end

      def hook?
        @hook
      end

      def step(*)
      end

      def before_hook(*)
        @hook = true
        @type = :before
      end

      def after_hook(*)
        @hook = true
        @type = :after
      end

      def after_step_hook(*)
        @hook = true
        @type = :after_step
      end

      def around_hook(*)
        @hook = true
        @type = :around
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
cucumber-3.2.0 lib/cucumber/formatter/hook_query_visitor.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/cucumber-3.1.2/lib/cucumber/formatter/hook_query_visitor.rb
cucumber-3.1.2 lib/cucumber/formatter/hook_query_visitor.rb
cucumber-3.1.1 lib/cucumber/formatter/hook_query_visitor.rb