From ce5fc1067c0dedc18b0c9ddc8aaff10645c6a6d5 Mon Sep 17 00:00:00 2001 From: KtorZ Date: Thu, 16 May 2019 11:22:52 +0200 Subject: [PATCH] Verify stderr output from the CLI too --- .../Test/Integration/Scenario/CLISpec.hs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/http-bridge/test/integration/Test/Integration/Scenario/CLISpec.hs b/lib/http-bridge/test/integration/Test/Integration/Scenario/CLISpec.hs index 2c8c05764ce..8df72ca6d57 100644 --- a/lib/http-bridge/test/integration/Test/Integration/Scenario/CLISpec.hs +++ b/lib/http-bridge/test/integration/Test/Integration/Scenario/CLISpec.hs @@ -18,7 +18,7 @@ import Data.List import Data.Text ( Text ) import System.Command - ( Exit (..), Stdout (..), command ) + ( Exit (..), Stderr (..), Stdout (..), command ) import System.Exit ( ExitCode (..) ) import Test.Hspec @@ -74,31 +74,35 @@ specWithCluster :: SpecWith Context specWithCluster = do it "CLI - Can get a wallet" $ \ctx -> do walId <- createWallet ctx "1st CLI Wallet" mnemonics15 - (Exit c, Stdout out) <- command [] "cardano-wallet" + (Exit c, Stdout out, Stderr err) <- command [] "cardano-wallet" ["wallet", "get", "--port", "1337", walId ] out `shouldContain` "1st CLI Wallet" + err `shouldBe` "Ok.\n" c `shouldBe` ExitSuccess it "CLI - Can list wallets" $ \ctx -> do _ <- createWallet ctx "1st CLI Wallet" mnemonics15 _ <- createWallet ctx "2nd CLI Wallet" mnemonics18 - (Exit c, Stdout out) <- command [] "cardano-wallet" + (Exit c, Stdout out, Stderr err) <- command [] "cardano-wallet" ["wallet", "list", "--port", "1337"] + err `shouldBe` "Ok.\n" out `shouldContain` "1st CLI Wallet" out `shouldContain` "2nd CLI Wallet" c `shouldBe` ExitSuccess it "CLI - Can update wallet name" $ \ctx -> do walId <- createWallet ctx "1st CLI Wallet" mnemonics15 - (Exit c, Stdout out) <- command [] "cardano-wallet" + (Exit c, Stdout out, Stderr err) <- command [] "cardano-wallet" ["wallet", "update", "--port", "1337", walId , "--name", "new name" ] + err `shouldBe` "Ok.\n" out `shouldContain` "new name" c `shouldBe` ExitSuccess it "CLI - Can delete wallet" $ \ctx -> do walId <- createWallet ctx "CLI Wallet" mnemonics15 - (Exit c, Stdout out) <- command [] "cardano-wallet" + (Exit c, Stdout out, Stderr err) <- command [] "cardano-wallet" ["wallet", "delete", "--port", "1337", walId ] + err `shouldBe` "Ok.\n" out `shouldNotContain` "CLI Wallet" c `shouldBe` ExitSuccess where