Sha256: 98c558d22043081f6da3c1d4db29218934de74bd08ec018272567119caaed1dd

Contents?: true

Size: 417 Bytes

Versions: 4

Compression:

Stored size: 417 Bytes

Contents

module Cucumber
  module Glue
    class WorldFactory
      def initialize(proc)
        @proc = proc || -> { Object.new }
      end

      def create_world
        @proc.call || raise_nil_world
      end

      def raise_nil_world
        raise NilWorld.new
      rescue NilWorld => e
        e.backtrace.clear
        e.backtrace.push(Glue.backtrace_line(@proc, 'World'))
        raise e
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

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