Newer
Older
dub_jkp / test / 0-init-fail.sh
@Martin Nowak Martin Nowak on 4 Jul 2017 487 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 2>/dev/null; then
  8. die $LINENO 'Init with unknown non-existing dependency expected to fail'
  9. fi
  10.  
  11. function cleanup {
  12. rm -rf $packname
  13. }
  14.  
  15. if [ -e $packname/dub.sdl ]; then # package is there, it should have failed
  16. cleanup
  17. die $LINENO "$packname/dub.sdl was not created"
  18. fi