Sha256: c0d2b8660ca11d69eedf0553dd8a8d7b3f76a70ecb04b77f5697ad1341603bfd

Contents?: true

Size: 690 Bytes

Versions: 7

Compression:

Stored size: 690 Bytes

Contents

# frozen_string_literal: true

require 'dry/container/stub'

module Dry
  module System
    class Container
      # @api private
      module Stubs
        def finalize!(&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

7 entries across 7 versions & 1 rubygems

Version Path
dry-system-0.17.0 lib/dry/system/stubs.rb
dry-system-0.15.0 lib/dry/system/stubs.rb
dry-system-0.14.1 lib/dry/system/stubs.rb
dry-system-0.14.0 lib/dry/system/stubs.rb
dry-system-0.13.2 lib/dry/system/stubs.rb
dry-system-0.13.1 lib/dry/system/stubs.rb
dry-system-0.13.0 lib/dry/system/stubs.rb