Skip to content
This repository
Browse code

Removed serve dependency. Tests are run against local files

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

0 notes on commit f998266

Please sign in to comment.
Something went wrong with that request. Please try again.