struct Foundation::MockEnv

Overview

Wraps a Hash(String, String), so #[]? delegates to h[key]? in order to give specs a hermetic env without messing with real process env vars.

Defined in:

foundation/env.cr

Constructors

Instance Method Summary

Instance methods inherited from struct Foundation::Env

[]?(key : String) : String | Nil []?, initialize initialize

Constructor methods inherited from struct Foundation::Env

new new

Constructor Detail

def self.new(h : Hash(String, String) = {} of String => String) #

[View source]

Instance Method Detail

def []=(key : String, value : String) : String #

[View source]
def []?(key : String) : String | Nil #

[View source]
def h : Hash(String, String) #

[View source]