Sha256: c8230fb9f57cb811441a5d1426f97ac606002b83f23461baeec5ecca35dddab7

Contents?: true

Size: 659 Bytes

Versions: 10

Compression:

Stored size: 659 Bytes

Contents

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

10 entries across 10 versions & 1 rubygems

Version Path
dry-system-0.12.0 lib/dry/system/stubs.rb
dry-system-0.11.0 lib/dry/system/stubs.rb
dry-system-0.10.1 lib/dry/system/stubs.rb
dry-system-0.10.0 lib/dry/system/stubs.rb
dry-system-0.9.2 lib/dry/system/stubs.rb
dry-system-0.9.1 lib/dry/system/stubs.rb
dry-system-0.9.0 lib/dry/system/stubs.rb
dry-system-0.8.1 lib/dry/system/stubs.rb
dry-system-0.8.0 lib/dry/system/stubs.rb
dry-system-0.7.3 lib/dry/system/stubs.rb