Permalink
Browse files

update to rspec2 and other cleanups

  • Loading branch information...
1 parent 0e5e50d commit dd8f730a06e060c19919499e4c1d59ae32892612 @joshbuddy committed Oct 18, 2010
Showing with 36 additions and 55 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 .rspec
  3. +1 −11 Gemfile
  4. +5 −6 Rakefile
  5. +24 −24 benchmarks/rec2.rb
  6. +4 −4 http_router.gemspec
  7. +0 −7 spec/spec.opts
  8. +0 −3 spec/spec_helper.rb
View
@@ -4,3 +4,4 @@ pkg
rdoc
Gemfile.lock
.rvmrc
+*.rbc
View
@@ -0,0 +1 @@
+--colour
View
@@ -1,13 +1,3 @@
source :rubygems
-gem 'rack', '>=1.0'
-gem 'url_mount', '>=0.2.1'
-
-group :development do
- gem 'rspec'
- gem 'rake'
- gem 'sinatra'
- gem 'rbench'
- gem 'code_stats'
- gem 'tumbler', ">= 0.0.11"
-end
+gemspec
View
@@ -1,13 +1,12 @@
require 'rubygems'
require 'bundler'
-require 'spec'
require 'code_stats'
-require 'spec/rake/spectask'
+require 'rspec/core/rake_task'
-Spec::Rake::SpecTask.new(:spec) do |t|
- t.spec_opts ||= []
- t.spec_opts << "--options" << "spec/spec.opts"
- t.spec_files = FileList['spec/**/*_spec.rb']
+desc "Run specs"
+RSpec::Core::RakeTask.new do |t|
+ #t.rspec_opts = %w(--options spec/spec.opts)
+ #t.ruby_opts = %w(-w)
end
require 'rake/rdoctask'
View
@@ -2,7 +2,7 @@
require 'rbench'
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
-require 'lib/http_router'
+require 'http_router'
#require 'http_router'
@@ -34,33 +34,33 @@
#simple_and_dynamic_env1 = Rack::MockRequest.env_for('/rails/controller/action/id')
#simple_and_dynamic_env2 = Rack::MockRequest.env_for('/greedy/controller/action/id')
#simple_and_dynamic_env3 = Rack::MockRequest.env_for('/greedy/hey.hello.html')
+5.times {
+ RBench.run(TIMES) do
-RBench.run(TIMES) do
-
- report "2 levels, static" do
- u.call(simple_env).first == 200 or raise
- end
-
- report "4 levels, static" do
- u.call(simple2_env).first == 200 or raise
- end
+ report "2 levels, static" do
+ u.call(simple_env).first == 200 or raise
+ end
- #report "8 levels, static" do
- # u.call(simple3_env).first == 200 or raise
- #end
+ report "4 levels, static" do
+ u.call(simple2_env).first == 200 or raise
+ end
- report "4 levels, 1 dynamic" do
- u.call(simple_and_dynamic_env).first == 200 or raise
- end
+ #report "8 levels, static" do
+ # u.call(simple3_env).first == 200 or raise
+ #end
- #report "8 levels, 3 dynamic" do
- # u.call(simple_and_dynamic_env1).first == 200 or raise
- #end
- #
- #report "4 levels, 1 greedy" do
- # u.call(simple_and_dynamic_env2).first == 200 or raise
- #end
+ report "4 levels, 1 dynamic" do
+ u.call(simple_and_dynamic_env).first == 200 or raise
+ end
-end
+ #report "8 levels, 3 dynamic" do
+ # u.call(simple_and_dynamic_env1).first == 200 or raise
+ #end
+ #
+ #report "4 levels, 1 greedy" do
+ # u.call(simple_and_dynamic_env2).first == 200 or raise
+ #end
+ end
+}
puts `ps -o rss= -p #{Process.pid}`.to_i
View
@@ -20,14 +20,14 @@ Gem::Specification.new do |s|
s.rubyforge_project = 'http_router'
# dependencies
- s.add_runtime_dependency 'rack', '>=1.0'
- s.add_runtime_dependency 'url_mount', '>=0.2.1'
- s.add_development_dependency 'rspec'
+ s.add_runtime_dependency 'rack', '>= 1.0.0'
+ s.add_runtime_dependency 'url_mount', '~> 0.2.1'
+ s.add_development_dependency 'rspec', '~> 2.0.0'
s.add_development_dependency 'code_stats'
s.add_development_dependency 'rake'
s.add_development_dependency 'sinatra'
s.add_development_dependency 'rbench'
- s.add_development_dependency 'bundler', ">= 1.0.0.rc4"
+ s.add_development_dependency 'bundler', "~> 1.0.0"
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
View
@@ -1,7 +0,0 @@
---colour
---format
-specdoc
---loadby
-mtime
---reverse
---backtrace
View
@@ -1,8 +1,5 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-require 'rubygems'
require 'http_router'
-require 'spec'
-require 'spec/autorun'
module CallWithMockRequestMixin
def call_with_mock_request(url = "/sample", method = "GET", params = Hash.new)

0 comments on commit dd8f730

Please sign in to comment.