Skip to content

Commit 86b43ba

Browse files
committed
Add bootstrap/test/server scripts
1 parent 71cd225 commit 86b43ba

File tree

5 files changed

+25
-9
lines changed

5 files changed

+25
-9
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

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)