Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cleanup

  • Loading branch information...
commit 6280b4f549a28e50ba7914a581187345164fda1a 1 parent 6d40422
@jnewland authored
Showing with 4 additions and 9 deletions.
  1. +4 −9 spec/spec_helper.rb
View
13 spec/spec_helper.rb
@@ -6,6 +6,7 @@
require 'spec/interop/test'
require 'stringio'
require 'webrick'
+require File.expand_path(File.dirname(__FILE__) + "/../lib/rack_rubygems.rb")
Sinatra::Default.set(
:environment => :test,
@@ -14,16 +15,14 @@
:logging => true
)
-require File.expand_path(File.dirname(__FILE__) + "/../lib/rack_rubygems.rb")
-
module RackRubygemsTestHelpers
def should_match_webrick_behavior(url, server_method, method = :get)
#webrick
data = StringIO.new "#{method.to_s.capitalize} #{url} HTTP/1.0\r\n\r\n"
@webrick_request.parse data
-
@webrick.send(server_method, @webrick_request, @webrick_response)
+
#sinatra
send(method, url)
@response.should be_ok
@@ -40,10 +39,6 @@ def should_match_webrick_behavior(url, server_method, method = :get)
}
end
- def process_based_port
- @@process_based_port ||= 8000 + $$ % 1000
- end
-
end
Spec::Runner.configure do |config|
@@ -53,10 +48,10 @@ def process_based_port
use Rack::Compress
run RackRubygems.new
}
- @webrick = Gem::Server.new Gem.dir, process_based_port, false
+ @webrick = Gem::Server.new Gem.dir, (8000 + $$ % 1000), false
@webrick_request = WEBrick::HTTPRequest.new :Logger => nil
@webrick_response = WEBrick::HTTPResponse.new :HTTPVersion => '1.0'
}
config.include Sinatra::Test
config.include RackRubygemsTestHelpers
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.