Skip to content

Instantly share code, notes, and snippets.

@studious
Created August 1, 2016 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save studious/16256dbc2dc6fe20eaa4129b2ba17d37 to your computer and use it in GitHub Desktop.
Save studious/16256dbc2dc6fe20eaa4129b2ba17d37 to your computer and use it in GitHub Desktop.
Test scaffold for Rails project built with components
#!/bin/bash
result=0
cd "$( dirname "${BASH_SOURCE[0]}" )"
for test_script in $(find . -name test.sh); do
pushd `dirname $test_script` > /dev/null
./test.sh
result+=$?
popd > /dev/null
done
if [ $result -eq 0 ]; then
echo "SUCCESS"
else
echo "FAILURE"
fi
exit $result
#!/bin/bash
exit_code=0
echo "*** Running container app specs"
RAILS_ENV=test bundle exec rake environment db:create db:migrate
bundle exec rspec spec
exit_code+=$?
exit $exit_code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment