Newer
Older
dub_jkp / test / 0-init-fail-json.sh
@Martin Nowak Martin Nowak on 4 Jul 2017 499 bytes replace all usages of `exit`
  1. #!/usr/bin/env bash
  2.  
  3. . $(dirname "${BASH_SOURCE[0]}")/common.sh
  4. packname="0-init-fail-pack"
  5. deps="logger PACKAGE_DONT_EXIST" # would be very unlucky if it does exist...
  6.  
  7. if $$DUB init -n $packname $deps -f json 2>/dev/null; then
  8. die $LINENO 'Init with unknown non-existing dependency expected to fail'
  9. fi
  10.  
  11.  
  12. function cleanup {
  13. rm -rf $packname
  14. }
  15.  
  16. if [ -e $packname/dub.json ]; then # package is there, it should have failed
  17. cleanup
  18. die $LINENO "$packname/dub.json was not created"
  19. fi