Skip to content

Commit

Permalink
Merge pull request #457 from defunkt/scripts
Browse files Browse the repository at this point in the history
Add `bootstrap/test/server` scripts for development & testing
  • Loading branch information
mislav committed Nov 22, 2014
2 parents 37b32b0 + a3e7792 commit 93ccd72
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 12 deletions.
11 changes: 2 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source 'http://rubygems.org'

ruby '1.9.3'

gem 'sinatra'
gem 'json'
2 changes: 0 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
GEM
remote: http://rubygems.org/
specs:
json (1.8.1)
rack (1.5.2)
rack-protection (1.5.3)
rack
Expand All @@ -15,5 +14,4 @@ PLATFORMS
ruby

DEPENDENCIES
json
sinatra
1 change: 1 addition & 0 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"Gemfile",
"Gemfile.lock",
"vendor/",
"script/",
"test/"
]
}
4 changes: 4 additions & 0 deletions script/bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -e

bundle install
4 changes: 4 additions & 0 deletions script/server
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -e

exec bundle exec ruby ./test/app.rb
14 changes: 14 additions & 0 deletions script/test
Original file line number Diff line number Diff line change
@@ -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/"

0 comments on commit 93ccd72

Please sign in to comment.