mirror of
https://github.com/ilyakooo0/docker-hs.git
synced 2024-10-26 10:58:14 +03:00
Merge branch 'master' of https://github.com/denibertovic/docker-hs
This commit is contained in:
commit
75d2c5349d
@ -1348,7 +1348,7 @@ instance FromJSON EnvVar where
|
||||
parseJSON _ = fail "EnvVar is not a string"
|
||||
|
||||
instance ToJSON EnvVar where
|
||||
toJSON (EnvVar n v) = object [n .= v]
|
||||
toJSON (EnvVar n v) = JSON.String $ n <> T.pack "=" <> v
|
||||
|
||||
-- | ExposedPort represents a port (and it's type)
|
||||
-- that a container should expose to other containers or the host system.
|
||||
|
@ -164,6 +164,15 @@ testEntrypointJson = testGroup "Testing ContainerConfig JSON" [testSample1, test
|
||||
Just (Entrypoint sampleEntrypointArr)
|
||||
sampleEntrypointArr = ["cmd", "--some-flag", "--some-flag2"]
|
||||
|
||||
testEnvVarJson :: TestTree
|
||||
testEnvVarJson = testGroup "Testing EnvVar JSON" [testSampleEncode, testSampleDecode]
|
||||
where
|
||||
testSampleEncode =
|
||||
testCase "Test toJSON" $ assert $ JSON.toJSON (EnvVar "cellar" "door") == JSON.String "cellar=door"
|
||||
testSampleDecode =
|
||||
testCase "Test fromJSON" $ assert $ (JSON.decode "\"cellar=door\"" :: Maybe EnvVar) ==
|
||||
Just (EnvVar "cellar" "door")
|
||||
|
||||
integrationTests :: TestTree
|
||||
integrationTests =
|
||||
testGroup
|
||||
@ -184,6 +193,7 @@ jsonTests =
|
||||
, testLabelsJson
|
||||
, testLogDriverOptionsJson
|
||||
, testEntrypointJson
|
||||
, testEnvVarJson
|
||||
]
|
||||
|
||||
setup :: IO ()
|
||||
|
Loading…
Reference in New Issue
Block a user