module Gruf::Rspec::Configuration
Represents configuration settings for the system
Constants
- DEFAULT_RSPEC_PATH
- VALID_CONFIG_KEYS
Public Class Methods
extended(base)
click to toggle source
Whenever this is extended into a class, setup the defaults
# File lib/gruf/rspec/configuration.rb, line 42 def self.extended(base) base.reset end
Public Instance Methods
configure() { |self| ... }
click to toggle source
Yield self for ruby-style initialization
@yields [Gruf::Rspec::Configuration] The configuration object for gruf @return [Gruf::Rspec::Configuration] The configuration object for gruf
# File lib/gruf/rspec/configuration.rb, line 52 def configure yield self end
options()
click to toggle source
Return the current configuration options as a Hash
@return [Hash] The configuration for gruf, represented as a Hash
# File lib/gruf/rspec/configuration.rb, line 61 def options opts = {} VALID_CONFIG_KEYS.each_key do |k| opts.merge!(k => send(k)) end opts end
reset()
click to toggle source
Set the default configuration onto the extended class
@return [Hash] options The reset options hash
# File lib/gruf/rspec/configuration.rb, line 74 def reset VALID_CONFIG_KEYS.each do |k, v| send("#{k}=", v) end self.rpc_spec_path = ::ENV.fetch('RPC_SPEC_PATH', DEFAULT_RSPEC_PATH).to_s options end