Permalink
Browse files

Removed serve dependency. Tests are run against local files

  • Loading branch information...
rwz committed Apr 22, 2012
1 parent 97527f0 commit f998266d2b690d04468a04567dc6570a2ac15c7a
Showing with 5 additions and 27 deletions.
  1. +0 −1 Gemfile
  2. +0 −17 Gemfile.lock
  3. +2 −7 Rakefile
  4. +3 −2 test/run-qunit.js
View
@@ -1,5 +1,4 @@
source :rubygems
-gem 'serve'
gem 'uglifier'
gem 'rake'
View
@@ -1,26 +1,10 @@
GEM
remote: http://rubygems.org/
specs:
- activesupport (3.2.3)
- i18n (~> 0.6)
- multi_json (~> 1.0)
execjs (1.3.0)
multi_json (~> 1.0)
- i18n (0.6.0)
multi_json (1.2.0)
- rack (1.4.1)
- rack-test (0.6.1)
- rack (>= 1.0)
rake (0.9.2.2)
- serve (1.5.1)
- activesupport (~> 3.0)
- i18n
- rack (~> 1.2)
- rack-test (~> 0.5)
- tilt (~> 1.3)
- tzinfo
- tilt (1.3.3)
- tzinfo (0.3.33)
uglifier (1.2.4)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
@@ -30,5 +14,4 @@ PLATFORMS
DEPENDENCIES
rake
- serve
uglifier
View
@@ -13,16 +13,11 @@ end
desc 'Run tests'
task :test do
- pid = spawn('bundle exec serve', err: '/dev/null')
- sleep 2
-
puts "Running underscore.string test suite."
- result1 = system %{phantomjs ./test/run-qunit.js "http://localhost:4000/test/test.html"}
+ result1 = system %{phantomjs ./test/run-qunit.js "test/test.html"}
puts "Running Underscore test suite."
- result2 = system %{phantomjs ./test/run-qunit.js "http://localhost:4000/test/test_underscore/test.html"}
-
- Process.kill 'INT', pid
+ result2 = system %{phantomjs ./test/run-qunit.js "test/test_underscore/test.html"}
exit(result1 && result2 ? 0 : 1)
end
View
@@ -15,13 +15,14 @@ function waitFor(test, complete, timeout) {
}
-var page = new WebPage()
+var fs = require('fs'), page = require('webpage').create();
+var url = 'file://localhost' + fs.workingDirectory + '/' + phantom.args[0];
page.onConsoleMessage = function(msg) {
console.log(msg)
}
-page.open(phantom.args[0], function(status) {
+page.open(url, function(status) {
waitFor(function() {
return page.evaluate(function(){
var el = document.getElementById('qunit-testresult')

0 comments on commit f998266

Please sign in to comment.