Kitura / CloudEnvironment

Convenience Swift package for accessing environment variables, credentials.
Apache License 2.0
12 stars 16 forks source link

Add tests for getString() and getDictionary() #57

Open helenmasters opened 5 years ago

helenmasters commented 5 years ago

There are currently no tests for either cloudEnv.getDictionary(name: String) or cloudEnv.getString(name: String) we should add these in.

petershaw commented 5 years ago

Maybe this is why it does not work for me?

this is my .config:

{
    "PORT": 8090,
    "cmsurl": "http://localhost:8080",
    "cms": {
        "foo": 1
    }
}

Changing the port works beautiful, but

        let dict = cloudEnv.getDictionary(name: "cms")
        dump(dict)
        print( cloudEnv.getString(name: "cmsurl") )

turns out as:

- nil
nil

am I doing in wrong, or is it broken?