Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove Rails-oriented integration tests

It's too much overhead to keep Rails-specific tests working,
especially when it's hauling in an ancient version of SQLite3.
Since Rails 3 has settled down with Rack and unicorn_rails is
unlikely to need changing in the future, we can drop these
tests.
  • Loading branch information...
commit 91a3cde091d4ae6ff436681f155b3907daae1c04 1 parent f4f2de4
Eric Wong authored
Showing with 2 additions and 1,598 deletions.
  1. +2 −29 GNUmakefile
  2. +0 −18 script/isolate_for_tests
  3. +0 −4 t/rails3-app/.gitignore
  4. +0 −26 t/rails3-app/Gemfile
  5. +0 −10 t/rails3-app/Rakefile
  6. +0 −4 t/rails3-app/app/controllers/application_controller.rb
  7. +0 −2  t/rails3-app/app/helpers/application_helper.rb
  8. +0 −14 t/rails3-app/app/views/layouts/application.html.erb
  9. +0 −4 t/rails3-app/config.ru
  10. +0 −46 t/rails3-app/config/application.rb
  11. +0 −6 t/rails3-app/config/boot.rb
  12. +0 −22 t/rails3-app/config/database.yml
  13. +0 −5 t/rails3-app/config/environment.rb
  14. +0 −19 t/rails3-app/config/environments/development.rb
  15. +0 −42 t/rails3-app/config/environments/production.rb
  16. +0 −32 t/rails3-app/config/environments/test.rb
  17. +0 −7 t/rails3-app/config/initializers/backtrace_silencers.rb
  18. +0 −10 t/rails3-app/config/initializers/inflections.rb
  19. +0 −5 t/rails3-app/config/initializers/mime_types.rb
  20. +0 −7 t/rails3-app/config/initializers/secret_token.rb
  21. +0 −8 t/rails3-app/config/initializers/session_store.rb
  22. +0 −5 t/rails3-app/config/locales/en.yml
  23. +0 −58 t/rails3-app/config/routes.rb
  24. +0 −7 t/rails3-app/db/seeds.rb
  25. +0 −2  t/rails3-app/doc/README_FOR_APP
  26. 0  t/rails3-app/lib/tasks/.gitkeep
  27. +0 −1  t/rails3-app/public/404.html
  28. +0 −1  t/rails3-app/public/500.html
  29. +0 −1  t/rails3-app/public/x.txt
  30. +0 −9 t/rails3-app/script/rails
  31. +0 −9 t/rails3-app/test/performance/browsing_test.rb
  32. +0 −13 t/rails3-app/test/test_helper.rb
  33. 0  t/rails3-app/vendor/plugins/.gitkeep
  34. +0 −28 t/t0300-rails3-basic.sh
  35. +0 −33 t/t0301-rails3-missing-config-ru.sh
  36. +0 −32 t/t0302-rails3-alt-working_directory.sh
  37. +0 −56 t/t0303-rails3-alt-working_directory_config.ru.sh
  38. +0 −52 t/t0304-rails3-alt-working_directory_no_embed_cli.sh
  39. +0 −27 t/test-rails3.sh
  40. +0 −2  test/rails/app-1.2.3/.gitignore
  41. +0 −7 test/rails/app-1.2.3/Rakefile
  42. +0 −6 test/rails/app-1.2.3/app/controllers/application.rb
  43. +0 −36 test/rails/app-1.2.3/app/controllers/foo_controller.rb
  44. +0 −4 test/rails/app-1.2.3/app/helpers/application_helper.rb
  45. +0 −11 test/rails/app-1.2.3/config/boot.rb
  46. +0 −12 test/rails/app-1.2.3/config/database.yml
  47. +0 −13 test/rails/app-1.2.3/config/environment.rb
  48. +0 −9 test/rails/app-1.2.3/config/environments/development.rb
  49. +0 −5 test/rails/app-1.2.3/config/environments/production.rb
  50. +0 −6 test/rails/app-1.2.3/config/routes.rb
  51. 0  test/rails/app-1.2.3/db/.gitignore
  52. +0 −1  test/rails/app-1.2.3/log/.gitignore
  53. +0 −1  test/rails/app-1.2.3/public/404.html
  54. +0 −1  test/rails/app-1.2.3/public/500.html
  55. +0 −2  test/rails/app-2.0.2/.gitignore
  56. +0 −7 test/rails/app-2.0.2/Rakefile
  57. +0 −4 test/rails/app-2.0.2/app/controllers/application.rb
  58. +0 −36 test/rails/app-2.0.2/app/controllers/foo_controller.rb
  59. +0 −4 test/rails/app-2.0.2/app/helpers/application_helper.rb
  60. +0 −11 test/rails/app-2.0.2/config/boot.rb
  61. +0 −12 test/rails/app-2.0.2/config/database.yml
  62. +0 −17 test/rails/app-2.0.2/config/environment.rb
  63. +0 −8 test/rails/app-2.0.2/config/environments/development.rb
  64. +0 −5 test/rails/app-2.0.2/config/environments/production.rb
  65. +0 −6 test/rails/app-2.0.2/config/routes.rb
  66. 0  test/rails/app-2.0.2/db/.gitignore
  67. +0 −1  test/rails/app-2.0.2/log/.gitignore
  68. +0 −1  test/rails/app-2.0.2/public/404.html
  69. +0 −1  test/rails/app-2.0.2/public/500.html
  70. +0 −2  test/rails/app-2.1.2/.gitignore
  71. +0 −7 test/rails/app-2.1.2/Rakefile
  72. +0 −4 test/rails/app-2.1.2/app/controllers/application.rb
  73. +0 −36 test/rails/app-2.1.2/app/controllers/foo_controller.rb
  74. +0 −4 test/rails/app-2.1.2/app/helpers/application_helper.rb
  75. +0 −111 test/rails/app-2.1.2/config/boot.rb
  76. +0 −12 test/rails/app-2.1.2/config/database.yml
  77. +0 −17 test/rails/app-2.1.2/config/environment.rb
  78. +0 −7 test/rails/app-2.1.2/config/environments/development.rb
  79. +0 −5 test/rails/app-2.1.2/config/environments/production.rb
  80. +0 −6 test/rails/app-2.1.2/config/routes.rb
  81. 0  test/rails/app-2.1.2/db/.gitignore
  82. +0 −1  test/rails/app-2.1.2/log/.gitignore
  83. +0 −1  test/rails/app-2.1.2/public/404.html
  84. +0 −1  test/rails/app-2.1.2/public/500.html
  85. +0 −2  test/rails/app-2.2.2/.gitignore
  86. +0 −7 test/rails/app-2.2.2/Rakefile
  87. +0 −4 test/rails/app-2.2.2/app/controllers/application.rb
  88. +0 −36 test/rails/app-2.2.2/app/controllers/foo_controller.rb
  89. +0 −4 test/rails/app-2.2.2/app/helpers/application_helper.rb
  90. +0 −111 test/rails/app-2.2.2/config/boot.rb
  91. +0 −12 test/rails/app-2.2.2/config/database.yml
  92. +0 −17 test/rails/app-2.2.2/config/environment.rb
  93. +0 −7 test/rails/app-2.2.2/config/environments/development.rb
  94. +0 −5 test/rails/app-2.2.2/config/environments/production.rb
  95. +0 −6 test/rails/app-2.2.2/config/routes.rb
  96. 0  test/rails/app-2.2.2/db/.gitignore
  97. +0 −1  test/rails/app-2.2.2/log/.gitignore
  98. +0 −1  test/rails/app-2.2.2/public/404.html
  99. +0 −1  test/rails/app-2.2.2/public/500.html
  100. +0 −287 test/rails/test_rails.rb
View
31 GNUmakefile
@@ -32,16 +32,13 @@ MYLIBS = $(RUBYLIB):$(ISOLATE_LIBS)
# dunno how to implement this as concisely in Ruby, and hell, I love awk
awk_slow := awk '/def test_/{print FILENAME"--"$$2".n"}' 2>/dev/null
-rails_vers := $(subst test/rails/app-,,$(wildcard test/rails/app-*))
slow_tests := test/unit/test_server.rb test/exec/test_exec.rb \
test/unit/test_signals.rb test/unit/test_upload.rb
log_suffix = .$(RUBY_ENGINE).$(RUBY_VERSION).log
-T_r := $(wildcard test/rails/test*.rb)
-T := $(filter-out $(slow_tests) $(T_r), $(wildcard test/*/test*.rb))
+T := $(filter-out $(slow_tests), $(wildcard test/*/test*.rb))
T_n := $(shell $(awk_slow) $(slow_tests))
T_log := $(subst .rb,$(log_suffix),$(T))
T_n_log := $(subst .n,$(log_suffix),$(T_n))
-T_r_log := $(subst .r,$(log_suffix),$(T_r))
test_prefix = $(CURDIR)/test/$(RUBY_ENGINE)-$(RUBY_VERSION)
ext := ext/unicorn_http
@@ -93,7 +90,7 @@ $(slow_tests): $(test_prefix)/.stamp
test-integration: $(test_prefix)/.stamp
$(MAKE) -C t
-test-all: test test-rails test-integration
+test-all: test test-integration
TEST_OPTS = -v
check_test = grep '0 failures, 0 errors' $(t) >/dev/null
@@ -199,30 +196,6 @@ doc_gz:
for i in $(docs); do \
gzip --rsyncable -9 < $$i > $$i.gz; touch -r $$i $$i.gz; done
-rails_git_url = git://github.com/rails/rails.git
-rails_git := vendor/rails.git
-$(rails_git)/info/cloned-stamp:
- git clone --mirror -q $(rails_git_url) $(rails_git)
- > $@
-
-$(rails_git)/info/v2.2.3-stamp: $(rails_git)/info/cloned-stamp
- cd $(rails_git) && git fetch
- cd $(rails_git) && git rev-parse --verify refs/tags/v2.2.3
- > $@
-
-rails_tests := $(addsuffix .r,$(addprefix $(T_r).,$(rails_vers)))
-test-rails: $(rails_tests)
-$(T_r).%.r: t = $(addsuffix $(log_suffix),$@)
-$(T_r).%.r: rv = $(subst .r,,$(subst $(T_r).,,$@))
-$(T_r).%.r: extra = ' 'v$(rv)
-$(T_r).%.r: arg = $(T_r)
-$(T_r).%.r: export PATH := $(test_prefix)/bin:$(PATH)
-$(T_r).%.r: export RUBYLIB := $(test_prefix):$(test_prefix)/lib:$(MYLIBS)
-$(T_r).%.r: export UNICORN_RAILS_TEST_VERSION = $(rv)
-$(T_r).%.r: export RAILS_GIT_REPO = $(CURDIR)/$(rails_git)
-$(T_r).%.r: $(test_prefix)/.stamp $(rails_git)/info/v2.2.3-stamp
- $(run_test)
-
ifneq ($(VERSION),)
rfproject := mongrel
rfpackage := unicorn
View
18 script/isolate_for_tests
@@ -16,9 +16,6 @@ opts = {
pid = fork do
Isolate.now!(opts) do
- if RUBY_VERSION.to_f < 2.0
- gem 'sqlite3-ruby', '1.2.5'
- end
gem 'raindrops', '0.8.0'
gem 'kgio-monkey', '0.4.0'
gem 'kgio', '2.7.4'
@@ -33,18 +30,3 @@ File.open("#{dst}.#$$", "w") do |fp|
fp.puts "ISOLATE_LIBS=#{lib_paths.join(':')}"
end
File.rename("#{dst}.#$$", dst)
-
-# pure Ruby gems can be shared across all Rubies
-%w(3.0.0).each do |rails_ver|
- opts[:path] = "tmp/isolate/rails-#{rails_ver}"
- pid = fork do
- Isolate.now!(opts) do
- gem 'rake', '0.8.7'
- gem 'rails', rails_ver
- end
- end
- _, status = Process.waitpid2(pid)
- status.success? or abort status.inspect
- more = Dir["#{opts[:path]}/gems/*-*/lib"].map { |x| File.expand_path(x) }
- lib_paths.concat(more)
-end
View
4 t/rails3-app/.gitignore
@@ -1,4 +0,0 @@
-.bundle
-db/*.sqlite3
-log/*.log
-tmp/**/*
View
26 t/rails3-app/Gemfile
@@ -1,26 +0,0 @@
-source 'http://rubygems.org'
-
-# gem 'rails', '3.0.0'
-
-# Bundle edge Rails instead:
-# gem 'rails', :git => 'git://github.com/rails/rails.git'
-
-# gem 'sqlite3-ruby', :require => 'sqlite3'
-
-# Use unicorn as the web server
-# gem 'unicorn'
-
-# Deploy with Capistrano
-# gem 'capistrano'
-
-# Bundle the extra gems:
-# gem 'bj'
-# gem 'nokogiri', '1.4.1'
-# gem 'sqlite3-ruby', :require => 'sqlite3'
-# gem 'aws-s3', :require => 'aws/s3'
-
-# Bundle gems for certain environments:
-# gem 'rspec', :group => :test
-# group :test do
-# gem 'webrat'
-# end
View
10 t/rails3-app/Rakefile
@@ -1,10 +0,0 @@
-# Add your own tasks in files placed in lib/tasks ending in .rake,
-# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
-
-require File.expand_path('../config/application', __FILE__)
-
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-
-Rails::Application.load_tasks
View
4 t/rails3-app/app/controllers/application_controller.rb
@@ -1,4 +0,0 @@
-class ApplicationController < ActionController::Base
- protect_from_forgery
- layout 'application'
-end
View
2  t/rails3-app/app/helpers/application_helper.rb
@@ -1,2 +0,0 @@
-module ApplicationHelper
-end
View
14 t/rails3-app/app/views/layouts/application.html.erb
@@ -1,14 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>App</title>
- <%= stylesheet_link_tag :all %>
- <%= javascript_include_tag :defaults %>
- <%= csrf_meta_tag %>
-</head>
-<body>
-
-<%= yield %>
-
-</body>
-</html>
View
4 t/rails3-app/config.ru
@@ -1,4 +0,0 @@
-# This file is used by Rack-based servers to start the application.
-
-require ::File.expand_path('../config/environment', __FILE__)
-run App::Application
View
46 t/rails3-app/config/application.rb
@@ -1,46 +0,0 @@
-require File.expand_path('../boot', __FILE__)
-
-require 'rails/all'
-
-# If you have a Gemfile, require the gems listed there, including any gems
-# you've limited to :test, :development, or :production.
-Bundler.require(:default, Rails.env) if defined?(Bundler)
-
-module App
- class Application < Rails::Application
- # Settings in config/environments/* take precedence over those specified here.
- # Application configuration should go into files in config/initializers
- # -- all .rb files in that directory are automatically loaded.
-
- # Add additional load paths for your own custom dirs
- # config.load_paths += %W( #{config.root}/extras )
-
- # Only load the plugins named here, in the order given (default is alphabetical).
- # :all can be used as a placeholder for all plugins not explicitly named
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
-
- # Activate observers that should always be running
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
-
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
- # config.time_zone = 'Central Time (US & Canada)'
-
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
- # config.i18n.default_locale = :de
-
- # Configure generators values. Many other options are available, be sure to check the documentation.
- # config.generators do |g|
- # g.orm :active_record
- # g.template_engine :erb
- # g.test_framework :test_unit, :fixture => true
- # end
-
- # Configure the default encoding used in templates for Ruby 1.9.
- config.encoding = "utf-8"
-
- # Configure sensitive parameters which will be filtered from the log file.
- config.filter_parameters += [:password]
- end
-end
View
6 t/rails3-app/config/boot.rb
@@ -1,6 +0,0 @@
-require 'rubygems'
-# Set up gems listed in the Gemfile.
-if File.exist?(File.expand_path('../../Gemfile', __FILE__))
- require 'bundler'
- Bundler.setup
-end
View
22 t/rails3-app/config/database.yml
@@ -1,22 +0,0 @@
-# SQLite version 3.x
-# gem install sqlite3-ruby (not necessary on OS X Leopard)
-development:
- adapter: sqlite3
- database: db/development.sqlite3
- pool: 5
- timeout: 5000
-
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
-test:
- adapter: sqlite3
- database: db/test.sqlite3
- pool: 5
- timeout: 5000
-
-production:
- adapter: sqlite3
- database: db/production.sqlite3
- pool: 5
- timeout: 5000
View
5 t/rails3-app/config/environment.rb
@@ -1,5 +0,0 @@
-# Load the rails application
-require File.expand_path('../application', __FILE__)
-
-# Initialize the rails application
-App::Application.initialize!
View
19 t/rails3-app/config/environments/development.rb
@@ -1,19 +0,0 @@
-App::Application.configure do
- # Settings specified here will take precedence over those in config/environment.rb
-
- # In the development environment your application's code is reloaded on
- # every request. This slows down response time but is perfect for development
- # since you don't have to restart the webserver when you make code changes.
- config.cache_classes = false
-
- # Log error messages when you accidentally call methods on nil.
- config.whiny_nils = true
-
- # Show full error reports and disable caching
- config.consider_all_requests_local = true
- config.action_view.debug_rjs = true
- config.action_controller.perform_caching = false
-
- # Don't care if the mailer can't send
- config.action_mailer.raise_delivery_errors = false
-end
View
42 t/rails3-app/config/environments/production.rb
@@ -1,42 +0,0 @@
-App::Application.configure do
- # Settings specified here will take precedence over those in config/environment.rb
-
- # The production environment is meant for finished, "live" apps.
- # Code is not reloaded between requests
- config.cache_classes = true
-
- # Full error reports are disabled and caching is turned on
- config.consider_all_requests_local = false
- config.action_controller.perform_caching = true
-
- # Specifies the header that your server uses for sending files
- config.action_dispatch.x_sendfile_header = "X-Sendfile"
-
- # For nginx:
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
-
- # If you have no front-end server that supports something like X-Sendfile,
- # just comment this out and Rails will serve the files
-
- # See everything in the log (default is :info)
- # config.log_level = :debug
-
- # Use a different logger for distributed setups
- # config.logger = SyslogLogger.new
-
- # Use a different cache store in production
- # config.cache_store = :mem_cache_store
-
- # Disable Rails's static asset server
- # In production, Apache or nginx will already do this
- config.serve_static_assets = false
-
- # Enable serving of images, stylesheets, and javascripts from an asset server
- # config.action_controller.asset_host = "http://assets.example.com"
-
- # Disable delivery errors, bad email addresses will be ignored
- # config.action_mailer.raise_delivery_errors = false
-
- # Enable threaded mode
- # config.threadsafe!
-end
View
32 t/rails3-app/config/environments/test.rb
@@ -1,32 +0,0 @@
-App::Application.configure do
- # Settings specified here will take precedence over those in config/environment.rb
-
- # The test environment is used exclusively to run your application's
- # test suite. You never need to work with it otherwise. Remember that
- # your test database is "scratch space" for the test suite and is wiped
- # and recreated between test runs. Don't rely on the data there!
- config.cache_classes = true
-
- # Log error messages when you accidentally call methods on nil.
- config.whiny_nils = true
-
- # Show full error reports and disable caching
- config.consider_all_requests_local = true
- config.action_controller.perform_caching = false
-
- # Raise exceptions instead of rendering exception templates
- config.action_dispatch.show_exceptions = false
-
- # Disable request forgery protection in test environment
- config.action_controller.allow_forgery_protection = false
-
- # Tell Action Mailer not to deliver emails to the real world.
- # The :test delivery method accumulates sent emails in the
- # ActionMailer::Base.deliveries array.
- config.action_mailer.delivery_method = :test
-
- # Use SQL instead of Active Record's schema dumper when creating the test database.
- # This is necessary if your schema can't be completely dumped by the schema dumper,
- # like if you have constraints or database-specific column types
- # config.active_record.schema_format = :sql
-end
View
7 t/rails3-app/config/initializers/backtrace_silencers.rb
@@ -1,7 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
-# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
-
-# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
-# Rails.backtrace_cleaner.remove_silencers!
View
10 t/rails3-app/config/initializers/inflections.rb
@@ -1,10 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# Add new inflection rules using the following format
-# (all these examples are active by default):
-# ActiveSupport::Inflector.inflections do |inflect|
-# inflect.plural /^(ox)$/i, '\1en'
-# inflect.singular /^(ox)en/i, '\1'
-# inflect.irregular 'person', 'people'
-# inflect.uncountable %w( fish sheep )
-# end
View
5 t/rails3-app/config/initializers/mime_types.rb
@@ -1,5 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# Add new mime types for use in respond_to blocks:
-# Mime::Type.register "text/richtext", :rtf
-# Mime::Type.register_alias "text/html", :iphone
View
7 t/rails3-app/config/initializers/secret_token.rb
@@ -1,7 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# Your secret key for verifying the integrity of signed cookies.
-# If you change this key, all old signed cookies will become invalid!
-# Make sure the secret is at least 30 characters and all random,
-# no regular words or you'll be exposed to dictionary attacks.
-Rails.application.config.secret_token = '71ca844cc99ed2057a65cc6bd66b57fbbf69e8d4aef00072e41c3e896635e99ea485a6ed45f6e846d5547d614235df146a9756920b8b4a1726a53e75cda45bd1'
View
8 t/rails3-app/config/initializers/session_store.rb
@@ -1,8 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-Rails.application.config.session_store :cookie_store, :key => '_app_session'
-
-# Use the database for sessions instead of the cookie-based default,
-# which shouldn't be used to store highly confidential information
-# (create the session table with "rake db:sessions:create")
-# Rails.application.config.session_store :active_record_store
View
5 t/rails3-app/config/locales/en.yml
@@ -1,5 +0,0 @@
-# Sample localization file for English. Add more files in this directory for other locales.
-# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
-
-en:
- hello: "Hello world"
View
58 t/rails3-app/config/routes.rb
@@ -1,58 +0,0 @@
-App::Application.routes.draw do |map|
- # The priority is based upon order of creation:
- # first created -> highest priority.
-
- # Sample of regular route:
- # match 'products/:id' => 'catalog#view'
- # Keep in mind you can assign values other than :controller and :action
-
- # Sample of named route:
- # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
- # This route can be invoked with purchase_url(:id => product.id)
-
- # Sample resource route (maps HTTP verbs to controller actions automatically):
- # resources :products
-
- # Sample resource route with options:
- # resources :products do
- # member do
- # get :short
- # post :toggle
- # end
- #
- # collection do
- # get :sold
- # end
- # end
-
- # Sample resource route with sub-resources:
- # resources :products do
- # resources :comments, :sales
- # resource :seller
- # end
-
- # Sample resource route with more complex sub-resources
- # resources :products do
- # resources :comments
- # resources :sales do
- # get :recent, :on => :collection
- # end
- # end
-
- # Sample resource route within a namespace:
- # namespace :admin do
- # # Directs /admin/products/* to Admin::ProductsController
- # # (app/controllers/admin/products_controller.rb)
- # resources :products
- # end
-
- # You can have the root of your site routed with "root"
- # just remember to delete public/index.html.
- # root :to => "welcome#index"
-
- # See how all your routes lay out with "rake routes"
-
- # This is a legacy wild controller route that's not recommended for RESTful applications.
- # Note: This route will make all actions in every controller accessible via GET requests.
- # match ':controller(/:action(/:id(.:format)))'
-end
View
7 t/rails3-app/db/seeds.rb
@@ -1,7 +0,0 @@
-# This file should contain all the record creation needed to seed the database with its default values.
-# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
-#
-# Examples:
-#
-# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
-# Mayor.create(:name => 'Daley', :city => cities.first)
View
2  t/rails3-app/doc/README_FOR_APP
@@ -1,2 +0,0 @@
-Use this README file to introduce your application and point to useful places in the API for learning more.
-Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
View
0  t/rails3-app/lib/tasks/.gitkeep
No changes.
View
1  t/rails3-app/public/404.html
@@ -1 +0,0 @@
-404 Not Found
View
1  t/rails3-app/public/500.html
@@ -1 +0,0 @@
-500 Internal Server Error
View
1  t/rails3-app/public/x.txt
@@ -1 +0,0 @@
-HELLO
View
9 t/rails3-app/script/rails
@@ -1,9 +0,0 @@
-#!/usr/bin/env ruby
-# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
-
-ENV_PATH = File.expand_path('../../config/environment', __FILE__)
-BOOT_PATH = File.expand_path('../../config/boot', __FILE__)
-APP_PATH = File.expand_path('../../config/application', __FILE__)
-
-require BOOT_PATH
-require 'rails/commands'
View
9 t/rails3-app/test/performance/browsing_test.rb
@@ -1,9 +0,0 @@
-require 'test_helper'
-require 'rails/performance_test_help'
-
-# Profiling results for each test method are written to tmp/performance.
-class BrowsingTest < ActionDispatch::PerformanceTest
- def test_homepage
- get '/'
- end
-end
View
13 t/rails3-app/test/test_helper.rb
@@ -1,13 +0,0 @@
-ENV["RAILS_ENV"] = "test"
-require File.expand_path('../../config/environment', __FILE__)
-require 'rails/test_help'
-
-class ActiveSupport::TestCase
- # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
- #
- # Note: You'll currently still have to declare fixtures explicitly in integration tests
- # -- they do not yet inherit this setting
- fixtures :all
-
- # Add more helper methods to be used by all tests here...
-end
View
0  t/rails3-app/vendor/plugins/.gitkeep
No changes.
View
28 t/t0300-rails3-basic.sh
@@ -1,28 +0,0 @@
-#!/bin/sh
-. ./test-rails3.sh
-
-t_plan 3 "Rails 3 (beta) tests"
-
-t_begin "setup and start" && {
- rails3_app=$(cd rails3-app && pwd)
- rm -rf $t_pfx.app
- mkdir $t_pfx.app
- cd $t_pfx.app
- ( cd $rails3_app && tar cf - . ) | tar xf -
- $RAKE db:sessions:create
- $RAKE db:migrate
- unicorn_setup
- unicorn_rails -D -c $unicorn_config
- unicorn_wait_start
-}
-
-# add more tests here
-t_begin "hit with curl" && {
- test xHELLO = x"$(curl -sSf http://$listen/x.txt)"
-}
-
-t_begin "killing succeeds" && {
- kill $unicorn_pid
-}
-
-t_done
View
33 t/t0301-rails3-missing-config-ru.sh
@@ -1,33 +0,0 @@
-#!/bin/sh
-. ./test-rails3.sh
-
-t_plan 4 "Rails 3 (beta) tests for config.ru haters"
-
-t_begin "setup and start" && {
- rails3_app=$(cd rails3-app && pwd)
- rm -rf $t_pfx.app
- mkdir $t_pfx.app
- cd $t_pfx.app
- ( cd $rails3_app && tar cf - . ) | tar xf -
- rm config.ru
- $RAKE db:sessions:create
- $RAKE db:migrate
- unicorn_setup
- unicorn_rails -D -c $unicorn_config
- unicorn_wait_start
-}
-
-t_begin "static file serving works" && {
- test x"$(curl -sSf http://$listen/x.txt)" = xHELLO
-}
-
-# add more tests here
-t_begin "hit with curl" && {
- curl -v http://$listen/ || :
-}
-
-t_begin "killing succeeds" && {
- kill $unicorn_pid
-}
-
-t_done
View
32 t/t0302-rails3-alt-working_directory.sh
@@ -1,32 +0,0 @@
-#!/bin/sh
-. ./test-rails3.sh
-
-t_plan 3 "Rails 3 (beta) inside alt working_directory (no config.ru)"
-
-t_begin "setup and start" && {
- unicorn_setup
- rails3_app=$(cd rails3-app && pwd)
- rm -rf $t_pfx.app
- mkdir $t_pfx.app
- cd $t_pfx.app
- ( cd $rails3_app && tar cf - . ) | tar xf -
- rm config.ru
- $RAKE db:sessions:create
- $RAKE db:migrate
- unicorn_setup
- rm $pid
- echo "working_directory '$t_pfx.app'" >> $unicorn_config
- cd /
- unicorn_rails -D -c $unicorn_config
- unicorn_wait_start
-}
-
-t_begin "static file serving works" && {
- test x"$(curl -sSf http://$listen/x.txt)" = xHELLO
-}
-
-t_begin "killing succeeds" && {
- kill $unicorn_pid
-}
-
-t_done
View
56 t/t0303-rails3-alt-working_directory_config.ru.sh
@@ -1,56 +0,0 @@
-#!/bin/sh
-. ./test-rails3.sh
-
-t_plan 5 "Rails 3 (beta) inside alt working_directory (w/ config.ru)"
-
-t_begin "setup and start" && {
- unicorn_setup
- rtmpfiles unicorn_config_tmp usocket
- if test -e $usocket
- then
- die "unexpected $usocket"
- fi
- rails3_app=$(cd rails3-app && pwd)
- rm -rf $t_pfx.app
- mkdir $t_pfx.app
- cd $t_pfx.app
- ( cd $rails3_app && tar cf - . ) | tar xf -
- $RAKE db:sessions:create
- $RAKE db:migrate
- unicorn_setup
- rm $pid
-
- echo "#\\--daemonize --host $host --port $port -l $usocket" \
- >> $t_pfx.app/config.ru
-
- # we have --host/--port in config.ru instead
- grep -v ^listen $unicorn_config |
- grep -v ^pid > $unicorn_config_tmp
- echo "working_directory '$t_pfx.app'" >> $unicorn_config_tmp
- cd /
- unicorn_rails -c $unicorn_config_tmp
-}
-
-t_begin "pids in the right place" && {
- if test -e $pid
- then
- die "pid=$pid not expected"
- fi
-
- unicorn_rails_pid="$t_pfx.app/tmp/pids/unicorn.pid"
- unicorn_pid=$(cat $unicorn_rails_pid)
-}
-
-t_begin "static file serving works" && {
- test x"$(curl -sSf http://$listen/x.txt)" = xHELLO
-}
-
-t_begin "socket created" && {
- test -S $usocket
-}
-
-t_begin "killing succeeds" && {
- kill $unicorn_pid
-}
-
-t_done
View
52 t/t0304-rails3-alt-working_directory_no_embed_cli.sh
@@ -1,52 +0,0 @@
-#!/bin/sh
-. ./test-rails3.sh
-
-t_plan 5 "Rails 3 (beta) inside alt working_directory (no embedded switches)"
-
-t_begin "setup and start" && {
- unicorn_setup
- rtmpfiles unicorn_config_tmp usocket
- if test -e $usocket
- then
- die "unexpected $usocket"
- fi
- rails3_app=$(cd rails3-app && pwd)
- rm -rf $t_pfx.app
- mkdir $t_pfx.app
- cd $t_pfx.app
- ( cd $rails3_app && tar cf - . ) | tar xf -
- $RAKE db:sessions:create
- $RAKE db:migrate
- unicorn_setup
- rm $pid
-
- grep -v ^pid $unicorn_config > $unicorn_config_tmp
- echo "working_directory '$t_pfx.app'" >> $unicorn_config_tmp
- cd /
- unicorn_rails -c $unicorn_config_tmp \
- --daemonize --host $host --port $port -l $usocket
-}
-
-t_begin "pids in the right place" && {
- if test -e $pid
- then
- die "pid=$pid not expected"
- fi
-
- unicorn_rails_pid="$t_pfx.app/tmp/pids/unicorn.pid"
- unicorn_pid=$(cat $unicorn_rails_pid)
-}
-
-t_begin "static file serving works" && {
- test x"$(curl -sSf http://$listen/x.txt)" = xHELLO
-}
-
-t_begin "socket created" && {
- test -S $usocket
-}
-
-t_begin "killing succeeds" && {
- kill $unicorn_pid
-}
-
-t_done
View
27 t/test-rails3.sh
@@ -1,27 +0,0 @@
-. ./test-lib.sh
-RAILS_VERSION=${RAILS_VERSION-3.0.0}
-case $RUBY_VERSION in
-1.8.7|1.9.2) ;;
-*)
- t_info "RUBY_VERSION=$RUBY_VERSION unsupported for Rails 3"
- exit 0
- ;;
-esac
-
-arch_gems=../tmp/isolate/ruby-$RUBY_VERSION/gems
-rails_gems=../tmp/isolate/rails-$RAILS_VERSION/gems
-rails_bin="$rails_gems/rails-$RAILS_VERSION/bin/rails"
-if ! test -d "$arch_gems" || ! test -d "$rails_gems" || ! test -x "$rails_bin"
-then
- ( cd ../ && ./script/isolate_for_tests )
-fi
-
-for i in $arch_gems/*-* $rails_gems/*-*
-do
- if test -d $i/lib
- then
- RUBYLIB=$(cd $i/lib && pwd):$RUBYLIB
- fi
-done
-
-export RUBYLIB
View
2  test/rails/app-1.2.3/.gitignore
@@ -1,2 +0,0 @@
-/tmp
-/vendor
View
7 test/rails/app-1.2.3/Rakefile
@@ -1,7 +0,0 @@
-require(File.join(File.dirname(__FILE__), 'config', 'boot'))
-
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-
-require 'tasks/rails'
View
6 test/rails/app-1.2.3/app/controllers/application.rb
@@ -1,6 +0,0 @@
-# -*- encoding: binary -*-
-
-class ApplicationController < ActionController::Base
- # Pick a unique cookie name to distinguish our session data from others'
- session :session_key => "_unicorn_rails_test.#{rand}"
-end
View
36 test/rails/app-1.2.3/app/controllers/foo_controller.rb
@@ -1,36 +0,0 @@
-# -*- encoding: binary -*-
-
-require 'digest/sha1'
-class FooController < ApplicationController
- def index
- render :text => "FOO\n"
- end
-
- def xcookie
- cookies["foo"] = "cookie #$$"
- render :text => ""
- end
-
- def xnotice
- flash[:notice] = "session #$$"
- render :text => ""
- end
-
- def xpost
- if request.post?
- digest = Digest::SHA1.new
- out = "params: #{params.inspect}\n"
- if file = params[:file]
- loop do
- buf = file.read(4096) or break
- digest.update(buf)
- end
- out << "sha1: #{digest.to_s}\n"
- end
- headers['content-type'] = 'text/plain'
- render :text => out
- else
- render :status => 403, :text => "need post\n"
- end
- end
-end
View
4 test/rails/app-1.2.3/app/helpers/application_helper.rb
@@ -1,4 +0,0 @@
-# -*- encoding: binary -*-
-
-module ApplicationHelper
-end
View
11 test/rails/app-1.2.3/config/boot.rb
@@ -1,11 +0,0 @@
-# -*- encoding: binary -*-
-
-unless defined?(RAILS_ROOT)
- root_path = File.join(File.dirname(__FILE__), '..')
- RAILS_ROOT = root_path
-end
-
-unless defined?(Rails::Initializer)
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
- Rails::Initializer.run(:set_load_path)
-end
View
12 test/rails/app-1.2.3/config/database.yml
@@ -1,12 +0,0 @@
-development:
- adapter: sqlite3
- database: db/development.sqlite3
- timeout: 5000
-test:
- adapter: sqlite3
- database: db/test.sqlite3
- timeout: 5000
-production:
- adapter: sqlite3
- database: db/production.sqlite3
- timeout: 5000
View
13 test/rails/app-1.2.3/config/environment.rb
@@ -1,13 +0,0 @@
-# -*- encoding: binary -*-
-
-unless defined? RAILS_GEM_VERSION
- RAILS_GEM_VERSION = ENV['UNICORN_RAILS_VERSION'] # || '1.2.3'
-end
-
-# Bootstrap the Rails environment, frameworks, and default configuration
-require File.join(File.dirname(__FILE__), 'boot')
-
-Rails::Initializer.run do |config|
- config.frameworks -= [ :action_web_service, :action_mailer ]
- config.action_controller.session_store = :active_record_store
-end
View
9 test/rails/app-1.2.3/config/environments/development.rb
@@ -1,9 +0,0 @@
-# -*- encoding: binary -*-
-
-config.cache_classes = false
-config.whiny_nils = true
-config.breakpoint_server = true
-config.action_controller.consider_all_requests_local = true
-config.action_controller.perform_caching = false
-config.action_view.cache_template_extensions = false
-config.action_view.debug_rjs = true
View
5 test/rails/app-1.2.3/config/environments/production.rb
@@ -1,5 +0,0 @@
-# -*- encoding: binary -*-
-
-config.cache_classes = true
-config.action_controller.consider_all_requests_local = false
-config.action_controller.perform_caching = true
View
6 test/rails/app-1.2.3/config/routes.rb
@@ -1,6 +0,0 @@
-# -*- encoding: binary -*-
-
-ActionController::Routing::Routes.draw do |map|
- map.connect ':controller/:action/:id.:format'
- map.connect ':controller/:action/:id'
-end
View
0  test/rails/app-1.2.3/db/.gitignore
No changes.
View
1  test/rails/app-1.2.3/log/.gitignore
@@ -1 +0,0 @@
-*.log
View
1  test/rails/app-1.2.3/public/404.html
@@ -1 +0,0 @@
-404 Not Found
View
1  test/rails/app-1.2.3/public/500.html
@@ -1 +0,0 @@
-500 Internal Server Error
View
2  test/rails/app-2.0.2/.gitignore
@@ -1,2 +0,0 @@
-/tmp
-/vendor
View
7 test/rails/app-2.0.2/Rakefile
@@ -1,7 +0,0 @@
-require(File.join(File.dirname(__FILE__), 'config', 'boot'))
-
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-
-require 'tasks/rails'
View
4 test/rails/app-2.0.2/app/controllers/application.rb
@@ -1,4 +0,0 @@
-# -*- encoding: binary -*-
-
-class ApplicationController < ActionController::Base
-end
View
36 test/rails/app-2.0.2/app/controllers/foo_controller.rb
@@ -1,36 +0,0 @@
-# -*- encoding: binary -*-
-
-require 'digest/sha1'
-class FooController < ApplicationController
- def index
- render :text => "FOO\n"
- end
-
- def xcookie
- cookies["foo"] = "cookie #$$"
- render :text => ""
- end
-
- def xnotice
- flash[:notice] = "session #$$"
- render :text => ""
- end
-
- def xpost
- if request.post?
- digest = Digest::SHA1.new
- out = "params: #{params.inspect}\n"
- if file = params[:file]
- loop do
- buf = file.read(4096) or break
- digest.update(buf)
- end
- out << "sha1: #{digest.to_s}\n"
- end
- headers['content-type'] = 'text/plain'
- render :text => out
- else
- render :status => 403, :text => "need post\n"
- end
- end
-end
View
4 test/rails/app-2.0.2/app/helpers/application_helper.rb
@@ -1,4 +0,0 @@
-# -*- encoding: binary -*-
-
-module ApplicationHelper
-end
View
11 test/rails/app-2.0.2/config/boot.rb
@@ -1,11 +0,0 @@
-# -*- encoding: binary -*-
-
-unless defined?(RAILS_ROOT)
- root_path = File.join(File.dirname(__FILE__), '..')
- RAILS_ROOT = root_path
-end
-
-unless defined?(Rails::Initializer)
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
- Rails::Initializer.run(:set_load_path)
-end
View
12 test/rails/app-2.0.2/config/database.yml
@@ -1,12 +0,0 @@
-development:
- adapter: sqlite3
- database: db/development.sqlite3
- timeout: 5000
-test:
- adapter: sqlite3
- database: db/test.sqlite3
- timeout: 5000
-production:
- adapter: sqlite3
- database: db/production.sqlite3
- timeout: 5000
View
17 test/rails/app-2.0.2/config/environment.rb
@@ -1,17 +0,0 @@
-# -*- encoding: binary -*-
-
-unless defined? RAILS_GEM_VERSION
- RAILS_GEM_VERSION = ENV['UNICORN_RAILS_VERSION']
-end
-
-# Bootstrap the Rails environment, frameworks, and default configuration
-require File.join(File.dirname(__FILE__), 'boot')
-
-Rails::Initializer.run do |config|
- config.frameworks -= [ :action_web_service, :action_mailer ]
- config.action_controller.session_store = :active_record_store
- config.action_controller.session = {
- :session_key => "_unicorn_rails_test.#{rand}",
- :secret => "#{rand}#{rand}#{rand}#{rand}",
- }
-end
View
8 test/rails/app-2.0.2/config/environments/development.rb
@@ -1,8 +0,0 @@
-# -*- encoding: binary -*-
-
-config.cache_classes = false
-config.whiny_nils = true
-config.action_controller.consider_all_requests_local = true
-config.action_controller.perform_caching = false
-config.action_view.cache_template_extensions = false
-config.action_view.debug_rjs = true
View
5 test/rails/app-2.0.2/config/environments/production.rb
@@ -1,5 +0,0 @@
-# -*- encoding: binary -*-
-
-config.cache_classes = true
-config.action_controller.consider_all_requests_local = false
-config.action_controller.perform_caching = true
View
6 test/rails/app-2.0.2/config/routes.rb
@@ -1,6 +0,0 @@
-# -*- encoding: binary -*-
-
-ActionController::Routing::Routes.draw do |map|
- map.connect ':controller/:action/:id.:format'
- map.connect ':controller/:action/:id'
-end
View
0  test/rails/app-2.0.2/db/.gitignore
No changes.
View
1  test/rails/app-2.0.2/log/.gitignore
@@ -1 +0,0 @@
-*.log
View
1  test/rails/app-2.0.2/public/404.html
@@ -1 +0,0 @@
-404 Not Found
View
1  test/rails/app-2.0.2/public/500.html
@@ -1 +0,0 @@
-500 Internal Server Error
View
2  test/rails/app-2.1.2/.gitignore
@@ -1,2 +0,0 @@
-/tmp
-/vendor
View
7 test/rails/app-2.1.2/Rakefile
@@ -1,7 +0,0 @@
-require(File.join(File.dirname(__FILE__), 'config', 'boot'))
-
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-
-require 'tasks/rails'
View
4 test/rails/app-2.1.2/app/controllers/application.rb
@@ -1,4 +0,0 @@
-# -*- encoding: binary -*-
-
-class ApplicationController < ActionController::Base
-end
View
36 test/rails/app-2.1.2/app/controllers/foo_controller.rb
@@ -1,36 +0,0 @@
-# -*- encoding: binary -*-
-
-require 'digest/sha1'
-class FooController < ApplicationController
- def index
- render :text => "FOO\n"
- end
-
- def xcookie
- cookies["foo"] = "cookie #$$"
- render :text => ""
- end
-
- def xnotice
- flash[:notice] = "session #$$"
- render :text => ""
- end
-
- def xpost
- if request.post?
- digest = Digest::SHA1.new
- out = "params: #{params.inspect}\n"
- if file = params[:file]
- loop do
- buf = file.read(4096) or break
- digest.update(buf)
- end
- out << "sha1: #{digest.to_s}\n"
- end
- headers['content-type'] = 'text/plain'
- render :text => out
- else
- render :status => 403, :text => "need post\n"
- end
- end
-end
View
4 test/rails/app-2.1.2/app/helpers/application_helper.rb
@@ -1,4 +0,0 @@
-# -*- encoding: binary -*-
-
-module ApplicationHelper
-end
View
111 test/rails/app-2.1.2/config/boot.rb
@@ -1,111 +0,0 @@
-# -*- encoding: binary -*-
-
-# Don't change this file!
-# Configure your app in config/environment.rb and config/environments/*.rb
-
-RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
-
-module Rails
- class << self
- def boot!
- unless booted?
- preinitialize
- pick_boot.run
- end
- end
-
- def booted?
- defined? Rails::Initializer
- end
-
- def pick_boot
- (vendor_rails? ? VendorBoot : GemBoot).new
- end
-
- def vendor_rails?
- File.exist?("#{RAILS_ROOT}/vendor/rails")
- end
-
- def preinitialize
- load(preinitializer_path) if File.exist?(preinitializer_path)
- end
-
- def preinitializer_path
- "#{RAILS_ROOT}/config/preinitializer.rb"
- end
- end
-
- class Boot
- def run
- load_initializer
- Rails::Initializer.run(:set_load_path)
- end
- end
-
- class VendorBoot < Boot
- def load_initializer
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
- Rails::Initializer.run(:install_gem_spec_stubs)
- end
- end
-
- class GemBoot < Boot
- def load_initializer
- self.class.load_rubygems
- load_rails_gem
- require 'initializer'
- end
-
- def load_rails_gem
- if version = self.class.gem_version
- gem 'rails', version
- else
- gem 'rails'
- end
- rescue Gem::LoadError => load_error
- $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
- exit 1
- end
-
- class << self
- def rubygems_version
- Gem::RubyGemsVersion rescue nil
- end
-
- def gem_version
- if defined? RAILS_GEM_VERSION
- RAILS_GEM_VERSION
- elsif ENV.include?('RAILS_GEM_VERSION')
- ENV['RAILS_GEM_VERSION']
- else
- parse_gem_version(read_environment_rb)
- end
- end
-
- def load_rubygems
- require 'rubygems'
- min_version = '1.3.1'
- unless rubygems_version >= min_version
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
- exit 1
- end
-
- rescue LoadError
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
- exit 1
- end
-
- def parse_gem_version(text)
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
- end
-
- private
- def read_environment_rb
- File.read("#{RAILS_ROOT}/config/environment.rb")
- end
- end
- end
-end
-
-# All that for this:
-Rails.boot!
View
12 test/rails/app-2.1.2/config/database.yml
@@ -1,12 +0,0 @@
-development:
- adapter: sqlite3
- database: db/development.sqlite3
- timeout: 5000
-test:
- adapter: sqlite3
- database: db/test.sqlite3
- timeout: 5000
-production:
- adapter: sqlite3
- database: db/production.sqlite3
- timeout: 5000
View
17 test/rails/app-2.1.2/config/environment.rb
@@ -1,17 +0,0 @@
-# -*- encoding: binary -*-
-
-unless defined? RAILS_GEM_VERSION
- RAILS_GEM_VERSION = ENV['UNICORN_RAILS_VERSION']
-end
-
-# Bootstrap the Rails environment, frameworks, and default configuration
-require File.join(File.dirname(__FILE__), 'boot')
-
-Rails::Initializer.run do |config|
- config.frameworks -= [ :action_web_service, :action_mailer ]
- config.action_controller.session_store = :active_record_store
- config.action_controller.session = {
- :session_key => "_unicorn_rails_test.#{rand}",
- :secret => "#{rand}#{rand}#{rand}#{rand}",
- }
-end
View
7 test/rails/app-2.1.2/config/environments/development.rb
@@ -1,7 +0,0 @@
-# -*- encoding: binary -*-
-
-config.cache_classes = false
-config.whiny_nils = true
-config.action_controller.consider_all_requests_local = true
-config.action_controller.perform_caching = false
-config.action_view.debug_rjs = true
View
5 test/rails/app-2.1.2/config/environments/production.rb
@@ -1,5 +0,0 @@
-# -*- encoding: binary -*-
-
-config.cache_classes = true
-config.action_controller.consider_all_requests_local = false
-config.action_controller.perform_caching = true
View
6 test/rails/app-2.1.2/config/routes.rb
@@ -1,6 +0,0 @@
-# -*- encoding: binary -*-
-
-ActionController::Routing::Routes.draw do |map|
- map.connect ':controller/:action/:id.:format'
- map.connect ':controller/:action/:id'
-end
View
0  test/rails/app-2.1.2/db/.gitignore
No changes.
View
1  test/rails/app-2.1.2/log/.gitignore
@@ -1 +0,0 @@
-*.log
View
1  test/rails/app-2.1.2/public/404.html
@@ -1 +0,0 @@
-404 Not Found
View
1  test/rails/app-2.1.2/public/500.html
@@ -1 +0,0 @@
-500 Internal Server Error
View
2  test/rails/app-2.2.2/.gitignore
@@ -1,2 +0,0 @@
-/tmp
-/vendor
View
7 test/rails/app-2.2.2/Rakefile
@@ -1,7 +0,0 @@
-require(File.join(File.dirname(__FILE__), 'config', 'boot'))
-
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-
-require 'tasks/rails'
View
4 test/rails/app-2.2.2/app/controllers/application.rb
@@ -1,4 +0,0 @@
-# -*- encoding: binary -*-
-
-class ApplicationController < ActionController::Base
-end
View
36 test/rails/app-2.2.2/app/controllers/foo_controller.rb
@@ -1,36 +0,0 @@
-# -*- encoding: binary -*-
-
-require 'digest/sha1'
-class FooController < ApplicationController
- def index
- render :text => "FOO\n"
- end
-
- def xcookie
- cookies["foo"] = "cookie #$$"
- render :text => ""
- end
-
- def xnotice
- flash[:notice] = "session #$$"
- render :text => ""
- end
-
- def xpost
- if request.post?
- digest = Digest::SHA1.new
- out = "params: #{params.inspect}\n"
- if file = params[:file]
- loop do
- buf = file.read(4096) or break
- digest.update(buf)
- end
- out << "sha1: #{digest.to_s}\n"
- end
- headers['content-type'] = 'text/plain'
- render :text => out
- else
- render :status => 403, :text => "need post\n"
- end
- end
-end
View
4 test/rails/app-2.2.2/app/helpers/application_helper.rb
@@ -1,4 +0,0 @@
-# -*- encoding: binary -*-
-
-module ApplicationHelper
-end
View
111 test/rails/app-2.2.2/config/boot.rb
@@ -1,111 +0,0 @@
-# -*- encoding: binary -*-
-
-# Don't change this file!
-# Configure your app in config/environment.rb and config/environments/*.rb
-
-RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
-
-module Rails
- class << self
- def boot!
- unless booted?
- preinitialize
- pick_boot.run
- end
- end
-
- def booted?
- defined? Rails::Initializer
- end
-
- def pick_boot
- (vendor_rails? ? VendorBoot : GemBoot).new
- end
-
- def vendor_rails?
- File.exist?("#{RAILS_ROOT}/vendor/rails")
- end
-
- def preinitialize
- load(preinitializer_path) if File.exist?(preinitializer_path)
- end
-
- def preinitializer_path
- "#{RAILS_ROOT}/config/preinitializer.rb"
- end
- end
-
- class Boot
- def run
- load_initializer
- Rails::Initializer.run(:set_load_path)
- end
- end
-
- class VendorBoot < Boot
- def load_initializer
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
- Rails::Initializer.run(:install_gem_spec_stubs)
- end
- end
-
- class GemBoot < Boot
- def load_initializer
- self.class.load_rubygems
- load_rails_gem
- require 'initializer'
- end
-
- def load_rails_gem
- if version = self.class.gem_version
- gem 'rails', version
- else
- gem 'rails'
- end
- rescue Gem::LoadError => load_error
- $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
- exit 1
- end
-
- class << self
- def rubygems_version
- Gem::RubyGemsVersion rescue nil
- end
-
- def gem_version
- if defined? RAILS_GEM_VERSION
- RAILS_GEM_VERSION
- elsif ENV.include?('RAILS_GEM_VERSION')
- ENV['RAILS_GEM_VERSION']
- else
- parse_gem_version(read_environment_rb)
- end
- end
-
- def load_rubygems
- require 'rubygems'
- min_version = '1.3.1'
- unless rubygems_version >= min_version
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
- exit 1
- end
-
- rescue LoadError
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
- exit 1
- end
-
- def parse_gem_version(text)
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
- end
-
- private
- def read_environment_rb
- File.read("#{RAILS_ROOT}/config/environment.rb")
- end
- end
- end
-end
-
-# All that for this:
-Rails.boot!
View
12 test/rails/app-2.2.2/config/database.yml
@@ -1,12 +0,0 @@
-development:
- adapter: sqlite3
- database: db/development.sqlite3
- timeout: 5000
-test:
- adapter: sqlite3
- database: db/test.sqlite3
- timeout: 5000
-production:
- adapter: sqlite3
- database: db/production.sqlite3
- timeout: 5000
View
17 test/rails/app-2.2.2/config/environment.rb
@@ -1,17 +0,0 @@
-# -*- encoding: binary -*-
-
-unless defined? RAILS_GEM_VERSION
- RAILS_GEM_VERSION = ENV['UNICORN_RAILS_VERSION']
-end
-
-# Bootstrap the Rails environment, frameworks, and default configuration
-require File.join(File.dirname(__FILE__), 'boot')
-
-Rails::Initializer.run do |config|
- config.frameworks -= [ :action_web_service, :action_mailer ]
- config.action_controller.session_store = :active_record_store
- config.action_controller.session = {
- :session_key => "_unicorn_rails_test.#{rand}",
- :secret => "#{rand}#{rand}#{rand}#{rand}",
- }
-end
View
7 test/rails/app-2.2.2/config/environments/development.rb
@@ -1,7 +0,0 @@
-# -*- encoding: binary -*-
-
-config.cache_classes = false
-config.whiny_nils = true
-config.action_controller.consider_all_requests_local = true
-config.action_controller.perform_caching = false
-config.action_view.debug_rjs = true
View
5 test/rails/app-2.2.2/config/environments/production.rb
@@ -1,5 +0,0 @@
-# -*- encoding: binary -*-
-
-config.cache_classes = true
-config.action_controller.consider_all_requests_local = false
-config.action_controller.perform_caching = true
View
6 test/rails/app-2.2.2/config/routes.rb
@@ -1,6 +0,0 @@
-# -*- encoding: binary -*-
-
-ActionController::Routing::Routes.draw do |map|
- map.connect ':controller/:action/:id.:format'
- map.connect ':controller/:action/:id'
-end
View
0  test/rails/app-2.2.2/db/.gitignore
No changes.
View
1  test/rails/app-2.2.2/log/.gitignore
@@ -1 +0,0 @@
-*.log
View
1  test/rails/app-2.2.2/public/404.html
@@ -1 +0,0 @@
-404 Not Found
View
1  test/rails/app-2.2.2/public/500.html
@@ -1 +0,0 @@
-500 Internal Server Error
View
287 test/rails/test_rails.rb
@@ -1,287 +0,0 @@
-# -*- encoding: binary -*-
-
-# Copyright (c) 2009 Eric Wong
-require 'test/test_helper'
-
-# don't call exit(0) since it may be run under rake (but gmake is recommended)
-do_test = true
-
-$unicorn_rails_bin = ENV['UNICORN_RAILS_TEST_BIN'] || "unicorn_rails"
-redirect_test_io { do_test = system($unicorn_rails_bin, '-v') }
-
-unless do_test
- warn "#$unicorn_rails_bin not found in PATH=#{ENV['PATH']}, " \
- "skipping this test"
-end
-
-unless which('git')
- warn "git not found in PATH=#{ENV['PATH']}, skipping this test"
- do_test = false
-end
-
-if RAILS_GIT_REPO = ENV['RAILS_GIT_REPO']
- unless File.directory?(RAILS_GIT_REPO)
- warn "#{RAILS_GIT_REPO} not found, create it with:\n" \
- "\tgit clone --mirror git://github.com/rails/rails #{RAILS_GIT_REPO}" \
- "skipping this test for now"
- do_test = false
- end
-else
- warn "RAILS_GIT_REPO not defined, don't know where to git clone from"
- do_test = false
-end
-
-unless UNICORN_RAILS_TEST_VERSION = ENV['UNICORN_RAILS_TEST_VERSION']
- warn 'UNICORN_RAILS_TEST_VERSION not defined in environment, ' \
- 'skipping this test'
- do_test = false
-end
-
-RAILS_ROOT = "#{File.dirname(__FILE__)}/app-#{UNICORN_RAILS_TEST_VERSION}"
-unless File.directory?(RAILS_ROOT)
- warn "unsupported UNICORN_RAILS_TEST_VERSION=#{UNICORN_RAILS_TEST_VERSION}"
- do_test = false
-end
-
-ROR_V = UNICORN_RAILS_TEST_VERSION.split(/\./).map { |x| x.to_i }
-RB_V = RUBY_VERSION.split(/\./).map { |x| x.to_i }
-if RB_V[0] >= 2
- warn "skipping Ruby 2.0+ test with Rails <3"
- do_test = false
-elsif RB_V[0] >= 1 && RB_V[1] >= 9
- if RB_V[2] >= 2
- warn "Ruby 1.9.2+ is not compatible with Rails 2.x"
- do_test = false
- end
- unless ROR_V[0] >= 2 && ROR_V[1] >= 3
- warn "skipping Ruby >=1.9 test with Rails <2.3"
- do_test = false
- end
-end
-
-class RailsTest < Test::Unit::TestCase
- trap(:QUIT, 'IGNORE')
-
- COMMON_TMP = Tempfile.new('unicorn_tmp') unless defined?(COMMON_TMP)
-
- HEAVY_CFG = <<-EOS
-worker_processes 2
-timeout 30
-logger Logger.new('#{COMMON_TMP.path}')
- EOS
-
- def setup
- @pwd = Dir.pwd
- @tmpfile = Tempfile.new('unicorn_rails_test')
- @tmpdir = @tmpfile.path
- @tmpfile.close!
- assert_nothing_raised do
- FileUtils.cp_r(RAILS_ROOT, @tmpdir, :preserve => true)
- end
- Dir.chdir(@tmpdir)
- system('git', 'clone', '-nsq', RAILS_GIT_REPO, 'vendor/rails')
- Dir.chdir("#@tmpdir/vendor/rails") do
- system('git', 'reset', '-q', '--hard', "v#{UNICORN_RAILS_TEST_VERSION}")
- end
-
- assert(system('rake', 'db:sessions:create'))
- assert(system('rake', 'db:migrate'))
-
- @addr = ENV['UNICORN_TEST_ADDR'] || '127.0.0.1'
- @port = unused_port(@addr)
- @start_pid = $$
- @pid = nil
- end
-
- def test_launcher
- tmp_dirs = %w(cache pids sessions sockets)
- tmp_dirs.each { |dir| assert(! File.exist?("tmp/#{dir}")) }
- redirect_test_io { @pid = fork { exec 'unicorn_rails', "-l#@addr:#@port" } }
- wait_master_ready("test_stderr.#$$.log")
-
- # basic GET
- res = Net::HTTP.get_response(URI.parse("http://#@addr:#@port/foo"))
- assert_equal "FOO\n", res.body
- assert_match %r{^text/html\b}, res['Content-Type']
- assert_equal "4", res['Content-Length']
- assert_equal "200 OK", res['Status']
-
- # temp dirs exist
- tmp_dirs.each { |dir| assert(File.directory?("tmp/#{dir}")) }
-
- # can we set cookies?
- res = Net::HTTP.get_response(URI.parse("http://#@addr:#@port/foo/xcookie"))
- assert_equal "200", res.code
- assert_equal "200 OK", res['Status']
- cookies = res.get_fields('Set-Cookie')
- assert_equal 2, cookies.size
- assert_equal 1, cookies.grep(/\A_unicorn_rails_test\./).size
- assert_equal 1, cookies.grep(/\Afoo=cookie/).size
-
- # how about just a session?
- res = Net::HTTP.get_response(URI.parse("http://#@addr:#@port/foo/xnotice"))
- assert_equal "200", res.code
- assert_equal "200 OK", res['Status']
- cookies = res.get_fields('Set-Cookie')
- assert_equal 1, cookies.size
- assert_equal 1, cookies.grep(/\A_unicorn_rails_test\./).size
-
- # posting forms?
- uri = URI.parse("http://#@addr:#@port/foo/xpost")
- wait_master_ready("test_stderr.#$$.log")
- res = Net::HTTP.post_form(uri, {"a" => "b", "c"=>"d"})
- assert_equal "200", res.code
- params = res.body.split(/\n/).grep(/^params:/)
- assert_equal 1, params.size
- params = eval(params[0].gsub!(/\Aparams:/, ''))
- assert_equal Hash, params.class
- assert_equal 'b', params['a']
- assert_equal 'd', params['c']
- assert_equal "200 OK", res['Status']
-
- # try uploading a big file
- tmp = Tempfile.new('random')
- sha1 = Digest::SHA1.new
- assert_nothing_raised do
- File.open("/dev/urandom", "rb") do |fp|
- 256.times do
- buf = fp.sysread(4096)
- sha1.update(buf)
- tmp.syswrite(buf)
- end
- end
- end
-
- # fixed in Rack commit 44ed4640f077504a49b7f1cabf8d6ad7a13f6441,
- # no released version of Rails or Rack has this fix
- if RB_V[0] >= 1 && RB_V[1] >= 9
- warn "multipart broken with Rack 1.0.0 and Rails 2.3.2.1 under 1.9"
- else
- resp = `curl -isSfN -Ffile=@#{tmp.path} http://#@addr:#@port/foo/xpost`
- assert $?.success?
- resp = resp.split(/\r?\n/)
- grepped = resp.grep(/^sha1: (.{40})/)
- assert_equal 1, grepped.size
- assert_equal(sha1.hexdigest, /^sha1: (.{40})/.match(grepped.first)[1])
-
- grepped = resp.grep(/^Content-Type:\s+(.+)/i)
- assert_equal 1, grepped.size
- assert_match %r{^text/plain}, grepped.first.split(/\s*:\s*/)[1]
- assert_equal 1, resp.grep(/^Status:/i).size
- end
-
- # make sure we can get 403 responses, too
- uri = URI.parse("http://#@addr:#@port/foo/xpost")
- wait_master_ready("test_stderr.#$$.log")
- res = Net::HTTP.get_response(uri)
- assert_equal "403", res.code
- assert_equal "403 Forbidden", res['Status']
-
- # non existent controller
- uri = URI.parse("http://#@addr:#@port/asdf")
- res = Net::HTTP.get_response(uri)
- assert_equal "404", res.code
- assert_equal "404 Not Found", res['Status']
-
- # static files
-
- # ensure file we're about to serve is not there yet
- res = Net::HTTP.get_response(URI.parse("http://#@addr:#@port/pid.txt"))
- assert_equal "404 Not Found", res['Status']
- assert_equal '404', res.code
-
- # can we serve text files based on suffix?
- File.open("public/pid.txt", "wb") { |fp| fp.syswrite("#$$\n") }
- res = Net::HTTP.get_response(URI.parse("http://#@addr:#@port/pid.txt"))
- assert_equal '200', res.code
- assert_equal "200 OK", res['Status']
- assert_match %r{^text/plain}, res['Content-Type']
- assert_equal "#$$\n", res.body
-
- # can we serve HTML files based on suffix?
- assert File.exist?("public/500.html")
- res = Net::HTTP.get_response(URI.parse("http://#@addr:#@port/500.html"))
- assert_equal '200', res.code
- assert_equal '200 OK', res['Status']
- assert_match %r{^text/html}, res['Content-Type']
- five_hundred_body = res.body
-
- # lets try pretending 500 is a controller that got cached
- assert ! File.exist?("public/500")
- assert_equal five_hundred_body, File.read("public/500.html")
- res = Net::HTTP.get_response(URI.parse("http://#@addr:#@port/500"))
- assert_equal '200', res.code
- assert_equal '200 OK', res['Status']
- assert_match %r{^text/html}, res['Content-Type']
- assert_equal five_hundred_body, res.body
- end
-
- def test_alt_url_root
- # cbf to actually work on this since I never use this feature (ewong)
- return unless ROR_V[0] >= 2 && ROR_V[1] >= 3
- redirect_test_io do
- @pid = fork { exec 'unicorn_rails', "-l#@addr:#@port", '-P/poo' }
- end
- wait_master_ready("test_stderr.#$$.log")
- res = Net::HTTP.get_response(URI.parse("http://#@addr:#@port/poo/foo"))
- # p res
- # p res.body
- # system 'cat', 'log/development.log'
- assert_equal "200", res.code
- assert_equal '200 OK', res['Status']
- assert_equal "FOO\n", res.body
- assert_match %r{^text/html\b}, res['Content-Type']
- assert_equal "4", res['Content-Length']
-
- res = Net::HTTP.get_response(URI.parse("http://#@addr:#@port/foo"))
- assert_equal "404", res.code
- assert_equal '404 Not Found', res['Status']
- end
-
- def test_alt_url_root_config_env
- # cbf to actually work on this since I never use this feature (ewong)
- return unless ROR_V[0] >= 2 && ROR_V[1] >= 3
- tmp = Tempfile.new('')
- tmp.syswrite("ENV['RAILS_RELATIVE_URL_ROOT'] = '/poo'\n")
- redirect_test_io do
- @pid = fork { exec 'unicorn_rails', "-l#@addr:#@port", "-c", tmp.path }
- end
- wait_master_ready("test_stderr.#$$.log")
- res = Net::HTTP.get_response(URI.parse("http://#@addr:#@port/poo/foo"))
- assert_equal "200", res.code
- assert_equal '200 OK', res['Status']
- assert_equal "FOO\n", res.body
- assert_match %r{^text/html\b}, res['Content-Type']
- assert_equal "4", res['Content-Length']
-
- res = Net::HTTP.get_response(URI.parse("http://#@addr:#@port/foo"))
- assert_equal "404", res.code
- assert_equal '404 Not Found', res['Status']
-
- res = Net::HTTP.get_response(URI.parse("http://#@addr:#@port/poo/x.txt"))
- assert_equal "200", res.code
- assert_equal "HELLO\n", res.body
- end
-
- def teardown
- return if @start_pid != $$
-
- if @pid
- Process.kill(:QUIT, @pid)
- _, status = Process.waitpid2(@pid)
- assert status.success?
- end
-
- Dir.chdir(@pwd)
- FileUtils.rmtree(@tmpdir)
- loop do
- Process.kill('-QUIT', 0)
- begin
- Process.waitpid(-1, Process::WNOHANG) or break
- rescue Errno::ECHILD
- break
- end
- end
- end
-
-end if do_test
Please sign in to comment.
Something went wrong with that request. Please try again.