Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for the list-packages command #304

Merged
merged 2 commits into from Jul 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions package.yaml
Expand Up @@ -128,6 +128,10 @@ executables:
tests:
spec:
defaults: hspec/hspec@master
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- base >= 4.7 && < 5
- text < 1.3
Expand Down
16 changes: 16 additions & 0 deletions test/SpagoSpec.hs
Expand Up @@ -214,3 +214,19 @@ spec = around_ setup $ do
-- to have built stuff for us)
spago ["bundle-module", "--to", "bundle-module.js", "--no-build"] >>= shouldBeSuccess
checkFixture "bundle-module.js"

describe "spago list-packages" $ do

it "Spago should list-packages successfully" $ do

spago ["init"] >>= shouldBeSuccess
mv "packages.dhall" "packages-old.dhall"
writeTextFile "packages.dhall" "https://raw.githubusercontent.com/purescript/package-sets/psc-0.13.0-20190626/src/packages.dhall sha256:9905f07c9c3bd62fb3205e2108515811a89d55cff24f4341652f61ddacfcf148"
Dretch marked this conversation as resolved.
Show resolved Hide resolved
spago ["list-packages"] >>= shouldBeSuccessOutput "list-packages.txt"

it "Spago should list-packages in JSON successfully" $ do

spago ["init"] >>= shouldBeSuccess
mv "packages.dhall" "packages-old.dhall"
writeTextFile "packages.dhall" "https://raw.githubusercontent.com/purescript/package-sets/psc-0.13.0-20190626/src/packages.dhall sha256:9905f07c9c3bd62fb3205e2108515811a89d55cff24f4341652f61ddacfcf148"
spago ["list-packages", "--json"] >>= shouldBeSuccessOutput "list-packages.json"