Merged updates from trunk into stable branch
[feedcatcher.git] / vendor / rails / actionpack / test / abstract_unit.rb
1 $:.unshift(File.dirname(__FILE__) + '/../lib')
2 $:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib')
3 $:.unshift(File.dirname(__FILE__) + '/fixtures/helpers')
4 $:.unshift(File.dirname(__FILE__) + '/fixtures/alternate_helpers')
5
6 require 'rubygems'
7 require 'yaml'
8 require 'stringio'
9 require 'test/unit'
10
11 gem 'mocha', '>= 0.9.5'
12 require 'mocha'
13
14 begin
15 require 'ruby-debug'
16 Debugger.settings[:autoeval] = true
17 Debugger.start
18 rescue LoadError
19 # Debugging disabled. `gem install ruby-debug` to enable.
20 end
21
22 require 'action_controller'
23 require 'action_controller/cgi_ext'
24 require 'action_controller/test_process'
25 require 'action_view/test_case'
26
27 # Show backtraces for deprecated behavior for quicker cleanup.
28 ActiveSupport::Deprecation.debug = true
29
30 ActionController::Base.logger = nil
31 ActionController::Routing::Routes.reload rescue nil
32
33 ActionController::Base.session_store = nil
34
35 # Register danish language for testing
36 I18n.backend.store_translations 'da', {}
37 I18n.backend.store_translations 'pt-BR', {}
38 ORIGINAL_LOCALES = I18n.available_locales.map(&:to_s).sort
39
40 FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures')
41 ActionView::Base.cache_template_loading = true
42 ActionController::Base.view_paths = FIXTURE_LOAD_PATH
43 CACHED_VIEW_PATHS = ActionView::Base.cache_template_loading? ?
44 ActionController::Base.view_paths :
45 ActionController::Base.view_paths.map {|path| ActionView::Template::EagerPath.new(path.to_s)}