diff --git a/.travis.yml b/.travis.yml index 00fd3e62..893b234f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,15 +2,8 @@ language: ruby rvm: - 1.9.3 -install: gem install sinatra - -before_script: - - "export DISPLAY=:99.0" - - "sh -e /etc/init.d/xvfb start" - - ruby ./test/app.rb 2>/dev/null & - - sleep 2 - -script: phantomjs ./test/run-qunit.coffee "http://localhost:4567/" +install: script/bootstrap +script: script/test notifications: email: false diff --git a/Gemfile b/Gemfile index 6adbdf5d..4ced5930 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,5 @@ source 'http://rubygems.org' +ruby '1.9.3' + gem 'sinatra' -gem 'json' \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 1aa7c3cf..32f6b123 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,6 @@ GEM remote: http://rubygems.org/ specs: - json (1.8.1) rack (1.5.2) rack-protection (1.5.3) rack @@ -15,5 +14,4 @@ PLATFORMS ruby DEPENDENCIES - json sinatra diff --git a/bower.json b/bower.json index f48a1569..e4b20259 100644 --- a/bower.json +++ b/bower.json @@ -10,6 +10,7 @@ "Gemfile", "Gemfile.lock", "vendor/", + "script/", "test/" ] } diff --git a/script/bootstrap b/script/bootstrap new file mode 100755 index 00000000..8742a5a4 --- /dev/null +++ b/script/bootstrap @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -e + +bundle install diff --git a/script/server b/script/server new file mode 100755 index 00000000..462a01cd --- /dev/null +++ b/script/server @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -e + +exec bundle exec ruby ./test/app.rb diff --git a/script/test b/script/test new file mode 100755 index 00000000..df1568b7 --- /dev/null +++ b/script/test @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -e + +port=4567 +script/server &>/dev/null & +pid=$! + +trap "kill $pid" EXIT INT + +while ! lsof -i :$port >/dev/null; do + sleep .05 +done + +phantomjs ./test/run-qunit.coffee "http://localhost:$port/"