test/minitest_helper.rb
def powertrack_config
    unless defined?(@loaded) && @loaded
      begin
        if File.exist?(POWERTRACK_CONFIG_FILEPATH)
          @pwtk_config = (YAML.load_file(POWERTRACK_CONFIG_FILEPATH) || {})
        else
          $stderr.puts "No PowerTrack config file found at '#{POWERTRACK_CONFIG_FILEPATH}'"
        end
      rescue Exception
        $stderr.puts "Exception while loading PowerTrack config file: #{$!.message}"
      ensure
        @pwtk_config ||= {}
      end

      # symbolize keys
      @pwtk_config = Hash[@pwtk_config.map{ |k, v| [k.to_sym, v] }]
      @loaded = true
    end

    @pwtk_config
  end
# Returns the PowerTrack configuration as defined in test/powertrack.yml.
Returns the PowerTrack configuration as defined in test/powertrack.yml.
Returns the PowerTrack configuration as defined in test / powertrack . yml .
def powertrack_config
    unless defined?(@loaded) && @loaded
      begin
        if File.exist?(POWERTRACK_CONFIG_FILEPATH)
          @pwtk_config = (YAML.load_file(POWERTRACK_CONFIG_FILEPATH) || {})
        else
          $stderr.puts "No PowerTrack config file found at '#{POWERTRACK_CONFIG_FILEPATH}'"
        end
      rescue Exception
        $stderr.puts "Exception while loading PowerTrack config file: #{$!.message}"
      ensure
        @pwtk_config ||= {}
      end
      @pwtk_config = Hash[@pwtk_config.map{ |k, v| [k.to_sym, v] }]
      @loaded = true
    end
    @pwtk_config
  end
def powertrack_config unless defined? ( @loaded ) && @loaded begin if File . exist? ( POWERTRACK_CONFIG_FILEPATH ) @pwtk_config = ( YAML . load_file ( POWERTRACK_CONFIG_FILEPATH ) || { } ) else $stderr . puts "No PowerTrack config file found at '#{POWERTRACK_CONFIG_FILEPATH}'" end rescue Exception $stderr . puts "Exception while loading PowerTrack config file: #{$!.message}" ensure @pwtk_config ||= { } end @pwtk_config = Hash [ @pwtk_config . map { | k , v | [ k . to_sym , v ] } ] @loaded = true end @pwtk_config end
Returns the PowerTrack configuration as defined in test/powertrack.yml.
Returns the PowerTrack configuration as defined in test / powertrack . yml .
# symbolize keys