Sha256: 8f860324cd1240cc46578f2a2850c32f78ff1a63f37dade2932d6e69ac1974f2

Contents?: true

Size: 672 Bytes

Versions: 1

Compression:

Stored size: 672 Bytes

Contents

module Gurke
  class Current
    attr_accessor :scenario, :step, :feature

    class << self
      def instance
        @instance ||= new
      end

      def scenario
        instance.scenario
      end

      def feature
        instance.feature
      end

      def step
        instance.step
      end
    end

    class Formatter < Gurke::Formatters::Base
      def before_scenario(scenario)
        Current.instance.scenario = scenario
      end

      def before_step(step)
        Current.instance.step = step
      end

      def before_feature(feature)
        Current.instance.feature = feature
      end
    end

    ::Gurke::Formatter.use Formatter
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gurke-1.0.1 lib/gurke/current.rb