Skip to content

Instantly share code, notes, and snippets.

@tansaku
Created September 6, 2018 12:05
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 tansaku/8cb9d393ccc80fd3a55ba82015208ada to your computer and use it in GitHub Desktop.
Save tansaku/8cb9d393ccc80fd3a55ba82015208ada to your computer and use it in GitHub Desktop.
first attempt at codio autograding script
#!/bin/bash
cd /home/codio/workspace/hw-ruby-intro
sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt-get update
sudo apt-get install rvm
source /usr/share/rvm/scripts/rvm
rvm use 2.4.0
gem install bundler
bundle
# rspec
OUTPUT1=("$(bundle exec rspec spec/part1_spec.rb)")
# echo "$OUTPUT1"
# if [ $? -ne 0 ]; then exit 1; fi
if echo "$OUTPUT1" | grep -q "12 examples, 0 failures"
then
echo "<h1>you rule</h1>"
exit 0
else
echo "<h1>you suck</h1>"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment