Sha256: 7c0ad6348daaf041afc42a99b32f90dec2599116f39f5f6cfd80ce4ae76df4de

Contents?: true

Size: 610 Bytes

Versions: 2

Compression:

Stored size: 610 Bytes

Contents

module Dry
  module Configurable
    # Methods meant to be used in a testing scenario
    module TestInterface
      # Resets configuration to default values
      #
      # @return [Dry::Configurable::Config]
      #
      # @api public
      def reset_config
        if self.is_a?(Class)
          @config = _settings.create_config
        else
          @config = self.class._settings.create_config
        end
      end
    end

    # Mixes in test interface into the configurable module
    #
    # @api public
    def enable_test_interface
      extend Dry::Configurable::TestInterface
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dry-configurable-0.8.1 lib/dry/configurable/test_interface.rb
dry-configurable-0.8.0 lib/dry/configurable/test_interface.rb