Source code for the book Effective Ruby by Peter J. Jones. http://www.effectiveruby.com/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

runtests.sh 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/sh
  2. ################################################################################
  3. # This file is part of the package effrb. It is subject to the license
  4. # terms in the LICENSE.md file found in the top-level directory of
  5. # this distribution and at https://github.com/pjones/effrb. No part of
  6. # the effrb package, including this file, may be copied, modified,
  7. # propagated, or distributed except according to the terms contained
  8. # in the LICENSE.md file.
  9. base=`dirname $0`
  10. RB_VERSIONS=`cat $base/ruby-versions.txt`
  11. export PATH=$HOME/.rbenv/bin:$PATH
  12. install () {
  13. if ! rbenv prefix $1 > /dev/null; then
  14. rbenv install $ver
  15. fi
  16. }
  17. run_test () {
  18. bundle install || exit 1
  19. bundle exec rake test || exit 1
  20. bundle exec fuzzbert --limit 2 fuzz/* || exit 1
  21. rm -f bug[0-9]*
  22. }
  23. for ver in $RB_VERSIONS; do
  24. install $ver
  25. export RBENV_VERSION=$ver
  26. eval "`rbenv init -`"
  27. if ! rbenv which bundle > /dev/null 2>&1; then
  28. gem install bundler
  29. fi
  30. rbenv rehash
  31. printf "====> RUBY_VERSION: "
  32. ruby -v
  33. OUT=`run_test 2>&1`
  34. [ $? -ne 0 ] && echo "$OUT" && exit 1
  35. echo "$OUT" | egrep '(warning|^[0-9]+ tests,)' | grep -v "unused variable"
  36. done