Sha256: a250025e899627691875ef344b0947eaf818da8e789523a7eadc5ea56bcfa8a0

Contents?: true

Size: 704 Bytes

Versions: 10

Compression:

Stored size: 704 Bytes

Contents

# frozen_string_literal: true

require "dry/container/stub"

module Dry
  module System
    class Container
      # @api private
      module Stubs
        def finalize!(freeze: true, &block)
          super(freeze: false, &block)
        end
      end

      # Enables stubbing container's components
      #
      # @example
      #   require 'dry/system/stubs'
      #
      #   MyContainer.enable_stubs!
      #   MyContainer.finalize!
      #
      #   MyContainer.stub('some.component', some_stub_object)
      #
      # @return Container
      #
      # @api public
      def self.enable_stubs!
        super
        extend ::Dry::System::Container::Stubs
        self
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
dry-system-0.27.2 lib/dry/system/stubs.rb
dry-system-0.27.1 lib/dry/system/stubs.rb
dry-system-0.27.0 lib/dry/system/stubs.rb
dry-system-0.26.0 lib/dry/system/stubs.rb
dry-system-0.25.0 lib/dry/system/stubs.rb
dry-system-0.24.0 lib/dry/system/stubs.rb
dry-system-0.23.0 lib/dry/system/stubs.rb
dry-system-0.22.0 lib/dry/system/stubs.rb
dry-system-0.21.0 lib/dry/system/stubs.rb
dry-system-0.20.0 lib/dry/system/stubs.rb