#188: use SPEC_GROUP for run specs on Travis

This commit is contained in:
Vokhmin Alexey V 2013-06-14 19:57:31 +04:00
parent 5f34bd74ef
commit 174ba56c89
2 changed files with 27 additions and 1 deletions

View File

@ -2,15 +2,24 @@ language: ruby
rvm: rvm:
- 1.9.3 - 1.9.3
bundler_args: --without development bundler_args: --without development
env:
- SPEC_GROUP=controllers
- SPEC_GROUP=api
- SPEC_GROUP=models
- SPEC_GROUP=others
before_install: before_install:
- sudo apt-get update - sudo apt-get update
- sudo apt-get --no-install-recommends install bash curl git patch bzip2 build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev libicu-dev - sudo apt-get --no-install-recommends install bash curl git patch bzip2 build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev libicu-dev
- gem update --system - gem update --system
- gem --version - gem --version
- git config --global user.email "abf@travis.com"
- git config --global user.name "ABF"
before_script: before_script:
- cp config/database.yml.sample config/database.yml - cp config/database.yml.sample config/database.yml
- cp config/application.yml.travis config/application.yml - cp config/application.yml.travis config/application.yml
- bundle exec rake db:create db:structure:load db:migrate - bundle exec rake db:create db:structure:load db:migrate
script: travis.sh
branches: branches:
only: only:
- master # - master
- 188-use-travis

17
travis.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash -e
rspec="bundle exec rspec"
if [ $SPEC_GROUP = 'controllers' ]
then
$rspec spec/controllers/*_spec.rb spec/controllers/admin/ spec/controllers/groups/ spec/controllers/platforms/ spec/controllers/projects/ spec/controllers/users/
elif [ $SPEC_GROUP = 'api' ]
then
$rspec spec/controllers/api/
elif [ $SPEC_GROUP = 'models' ]
then
$rspec spec/models/
elif [ $SPEC_GROUP = 'others' ]
then
$rspec spec/helpers/ spec/integration/ spec/lib/ spec/mailers/ spec/mailers/ spec/routing/
fi