Sha256: e6477d6cfadaf287896c7fd82e29c2f275469e61a856170491be1282103f8e32

Contents?: true

Size: 444 Bytes

Versions: 7

Compression:

Stored size: 444 Bytes

Contents

# frozen_string_literal: true

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
      rescue NilWorld => e
        e.backtrace.clear
        e.backtrace.push(Glue.backtrace_line(@proc, 'World'))
        raise e
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
cucumber-9.2.0 lib/cucumber/glue/world_factory.rb
cucumber-9.1.2 lib/cucumber/glue/world_factory.rb
cucumber-9.1.1 lib/cucumber/glue/world_factory.rb
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/cucumber-9.1.0/lib/cucumber/glue/world_factory.rb
cucumber-9.1.0 lib/cucumber/glue/world_factory.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/cucumber-9.0.2/lib/cucumber/glue/world_factory.rb
cucumber-9.0.2 lib/cucumber/glue/world_factory.rb