Skip to content

Commit 6a021d7

Browse files
Some comments and cleanup.
1 parent f202754 commit 6a021d7

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

test/unit/server.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
require 'pathname'
33
require 'json'
44

5-
require 'pp'
6-
75
class UnitTests < Sinatra::Application
86

97
PWD = Pathname.new( File.expand_path( File.dirname(__FILE__) ) )
@@ -66,13 +64,17 @@ def self.get_or_post(url, &block)
6664
redirect to("/test/#{params[:names]}")
6765
end
6866

67+
# /test/ will run all tests;
68+
# /test/foo,bar will run just "foo" and "bar" tests.
6969
get '/test/:names?' do
7070
names = params[:names]
7171
@suites = names.nil? ? SUITES : names.split(/,/).uniq
7272
@unique_asset_string = UNIQUE_ASSET_STRING.to_s
7373
erb :tests, :locals => { :suites => @suites }
7474
end
7575

76+
# Will read from disk each time. No server restart necessary when the
77+
# distributable is updated.
7678
get '/prototype.js' do
7779
content_type 'text/javascript'
7880
send_file PATH_TO_PROTOTYPE
@@ -83,7 +85,6 @@ def self.get_or_post(url, &block)
8385
# (a) they should be more prominent in the directory structure;
8486
# (b) they should never, ever get cached, and we want to enforce that
8587
# aggressively.
86-
8788
get '/js/tests/:filename' do
8889
filename = params[:filename]
8990
path = PATH_TO_TEST_JS.join(filename)
@@ -110,8 +111,6 @@ def self.get_or_post(url, &block)
110111
:body => request.body.read
111112
}
112113

113-
pp response[:headers]
114-
115114
content_type 'application/json'
116115
JSON.dump(response)
117116
end

test/unit/static/js/test_helpers.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// TODO: Ideally, none of the stuff in this file should use Prototype, so
2+
// that a broken method inside Prototype does not end up affecting the test
3+
// reporting.
14

25
(function () {
36
// Needed because Mocha's HTML test runner assumes the presence of

0 commit comments

Comments
 (0)