Ruby, Rspec & Travis-CI
Set Up
Clone Repo
$ git clone repo_name $ bundle install
Remove .git
$ rm -rf .git
Create your repo
Add this project to your repo
$ git init $ git add —all $ git commit -m ‘Initial commit’ $ git remote add origin {remote_url} $ git remote -v $ git push -u origin master
_Commit changes to your clean app
$ git status $ git add —all $ git commit -m ‘initial commit’ $ git push
Travis
- Sign in with Github
- Add your repo
CodeClimate
- Sign in with Github
- Add you repo
- Get the token and add it to your .travis.yml project > settings > test coverage > test reporter id
README
Update the README with your new badges
- Build Status Image
[](https://travis-ci.org/{your_github_name}/{your_repo_name})
- Code climate Image
[](https://codeclimate.com/github/{your_github_name}/{your_repo_name})
- Test coverage Image
[](https://codeclimate.com/github/{your_github_name}/{your_repo_name}/coverage)
Write your app
Now you’re set up with a blank ruby project to test builds, code quality and coverage throughout development!
Entry point
app.rb
Source files
/lib/main.rb
Test files
spec/main_spec.rb
Usage
To run the app
$ ruby app.rb
Testing
To run tests before committing changes
$ rake spec
When committing changes to master branch, your code will automatically build with Travis-CI and CodeClimate and update the badges in your repo’s README.