Skip to content

Commit

Permalink
replace hard-coded version in integration test with version from .cabal
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ committed Jun 6, 2019
1 parent efe88d5 commit 27da10a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions lib/http-bridge/cardano-wallet-http-bridge.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ test-suite integration
Test.Integration.Scenario.CLI.Mnemonics
Test.Integration.Scenario.CLI.Transactions
Test.Integration.Scenario.CLI.Wallets
Paths_cardano_wallet_http_bridge

benchmark restore
default-language:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ import Control.Monad
( forM_ )
import Data.List
( length )
import Data.Text
( Text )
import Data.Version
( showVersion )
import Paths_cardano_wallet_http_bridge
( version )
import System.Command
( Exit (..), Stderr (..), Stdout (..) )
import System.Exit
Expand All @@ -24,23 +26,20 @@ import Test.Hspec.Expectations.Lifted
import Test.Integration.Framework.DSL
( cardanoWalletCLI, cardanoWalletLauncherCLI, generateMnemonicsViaCLI )

import qualified Data.Text as T

version :: Text
version = "2019.5.24"
import qualified Data.List as L

spec :: SpecWith ()
spec = do
it "CLI_VERSION - cardano-wallet shows version" $ do
(Exit c, Stdout out) <- cardanoWalletCLI ["--version"]
let v = T.dropWhileEnd (== '\n') (T.pack out)
v `shouldBe` version
let v = L.dropWhileEnd (== '\n') out
v `shouldBe` (showVersion version)
c `shouldBe` ExitSuccess

it "CLI_VERSION - cardano-wallet-launcher shows version" $ do
(Exit c, Stdout out) <- cardanoWalletLauncherCLI ["--version"]
let v = T.dropWhileEnd (== '\n') (T.pack out)
v `shouldBe` version
let v = L.dropWhileEnd (== '\n') out
v `shouldBe` (showVersion version)
c `shouldBe` ExitSuccess

it "CLI_HELP - cardano-wallet-launcher shows help on bad argument" $ do
Expand Down

0 comments on commit 27da10a

Please sign in to comment.