Permalink
Browse files

Fix for 'jasmine:ci' task failure with large numbers of src files

  • Loading branch information...
1 parent 909d5e9 commit 7375b5279d66fe66842ed617db13a10d4224a860 @ragaskar ragaskar committed Feb 17, 2010
Showing with 20 additions and 17 deletions.
  1. +1 −0 Gemfile
  2. +1 −1 VERSION.yml
  3. +3 −3 jasmine.gemspec
  4. +14 −6 lib/jasmine/server.rb
  5. +1 −7 spec/server_spec.rb
View
@@ -1,3 +1,4 @@
+#jasmine-ruby is currently designed for use with bundler 0.8.0
gem "rake", "0.8.7"
gem "jeweler", "1.4.0"
gem "gemcutter", "0.2.1"
View
@@ -1,5 +1,5 @@
---
-:patch: 3
+:patch: 4
:major: 0
:build:
:minor: 4
View
@@ -1,15 +1,15 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# Instead, edit Jeweler::Tasks in rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{jasmine}
- s.version = "0.4.3"
+ s.version = "0.4.4"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Rajan Agaskar", "Christian Williams"]
- s.date = %q{2010-01-28}
+ s.date = %q{2010-02-16}
s.default_executable = %q{jasmine}
s.description = %q{Javascript BDD test framework}
s.email = %q{ragaskar@gmail.com}
View
@@ -12,7 +12,17 @@ def initialize(config)
end
def call(env)
- run
+ return not_found if env["PATH_INFO"] != "/"
+ return [200,{ 'Content-Type' => 'text/html' }, ''] if (env['REQUEST_METHOD'] == 'HEAD')
+ run if env['REQUEST_METHOD'] == 'GET'
+ end
+
+ def not_found
+ body = "File not found: #{@path_info}\n"
+ [404, {"Content-Type" => "text/plain",
+ "Content-Length" => body.size.to_s,
+ "X-Cascade" => "pass"},
+ [body]]
end
#noinspection RubyUnusedLocalVariable
@@ -59,8 +69,6 @@ def call(env)
class FocusedSuite
def initialize(config)
@config = config
-# @spec_files_or_proc = spec_files_or_proc || []
-# @options = options
end
def call(env)
@@ -102,10 +110,10 @@ def initialize(port, config)
app = Rack::Cascade.new([
Rack::URLMap.new({'/' => Rack::File.new(@config.src_dir)}),
- Rack::URLMap.new(thin_config),
- JsAlert.new
+ Rack::URLMap.new(thin_config)
+# JsAlert.new
])
-
+# Thin::Logging.trace = true
@thin = Thin::Server.new('0.0.0.0', @port, app)
end
View
@@ -47,7 +47,7 @@ def read(body)
describe "/ page" do
it "should load each js file in order" do
- code, headers, body = @thin_app.call("PATH_INFO" => "/", "SCRIPT_NAME" => "xxx")
+ code, headers, body = @thin_app.call("PATH_INFO" => "/", "SCRIPT_NAME" => "xxx", "REQUEST_METHOD" => 'GET')
code.should == 200
body = read(body)
body.should include("\"/src/file1.js")
@@ -56,10 +56,4 @@ def read(body)
end
end
- it "should display an error using JS for 404's" do
- code, headers, body = @thin_app.call("PATH_INFO" => "/spec/NonExistantFile.js", "SCRIPT_NAME" => "xxx")
- code.should == 200 # todo: shouldn't this be 404? will that work with all browsers?
- headers["Content-Type"].should == "application/javascript"
- read(body).should == "document.write('<p>Couldn\\'t load /spec/NonExistantFile.js!</p>');"
- end
end

0 comments on commit 7375b52

Please sign in to comment.