Skip to content

Commit 93ccd72

Browse files
committed
Merge pull request #457 from defunkt/scripts
Add `bootstrap/test/server` scripts for development & testing
2 parents 37b32b0 + a3e7792 commit 93ccd72

File tree

7 files changed

+27
-12
lines changed

7 files changed

+27
-12
lines changed

.travis.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,8 @@ language: ruby
22
rvm:
33
- 1.9.3
44

5-
install: gem install sinatra
6-
7-
before_script:
8-
- "export DISPLAY=:99.0"
9-
- "sh -e /etc/init.d/xvfb start"
10-
- ruby ./test/app.rb 2>/dev/null &
11-
- sleep 2
12-
13-
script: phantomjs ./test/run-qunit.coffee "http://localhost:4567/"
5+
install: script/bootstrap
6+
script: script/test
147

158
notifications:
169
email: false

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
source 'http://rubygems.org'
22

3+
ruby '1.9.3'
4+
35
gem 'sinatra'
4-
gem 'json'

Gemfile.lock

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
GEM
22
remote: http://rubygems.org/
33
specs:
4-
json (1.8.1)
54
rack (1.5.2)
65
rack-protection (1.5.3)
76
rack
@@ -15,5 +14,4 @@ PLATFORMS
1514
ruby
1615

1716
DEPENDENCIES
18-
json
1917
sinatra

bower.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"Gemfile",
1111
"Gemfile.lock",
1212
"vendor/",
13+
"script/",
1314
"test/"
1415
]
1516
}

script/bootstrap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
bundle install

script/server

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
exec bundle exec ruby ./test/app.rb

script/test

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
port=4567
5+
script/server &>/dev/null &
6+
pid=$!
7+
8+
trap "kill $pid" EXIT INT
9+
10+
while ! lsof -i :$port >/dev/null; do
11+
sleep .05
12+
done
13+
14+
phantomjs ./test/run-qunit.coffee "http://localhost:$port/"

0 commit comments

Comments
 (0)