Sha256: 68eb095a15ff69585587344ed8190dc2ebe50a93386649fa89cd96258ff57a6a

Contents?: true

Size: 418 Bytes

Versions: 3

Compression:

Stored size: 418 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

3 entries across 3 versions & 1 rubygems

Version Path
cucumber-3.0.1 lib/cucumber/glue/world_factory.rb
cucumber-3.0.0 lib/cucumber/glue/world_factory.rb
cucumber-3.0.0.pre.2 lib/cucumber/glue/world_factory.rb