aboutsummaryrefslogblamecommitdiffstats
path: root/actionpack/test/abstract_unit.rb
blob: 2d7b5f2af6a977279592eb6b08ccb212c3fa0d76 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                              
                                                                              
                                                        
 
              
                  

                           
                                   

                                        

                    


                                                              
                                   
                                                       
                                                   



                                                    



                                      



                                                                                
$:.unshift(File.dirname(__FILE__) + '/../lib')
$:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib/active_support')
$:.unshift(File.dirname(__FILE__) + '/fixtures/helpers')

require 'yaml'
require 'stringio'
require 'test/unit'
require 'action_controller'
require 'action_controller/cgi_ext'
require 'action_controller/test_process'

require 'ruby-debug'

# Show backtraces for deprecated behavior for quicker cleanup.
ActiveSupport::Deprecation.debug = true

ActionController::Base.logger = nil
ActionController::Base.ignore_missing_templates = false
ActionController::Routing::Routes.reload rescue nil


# Wrap tests that use Mocha and skip if unavailable.
def uses_mocha(test_name)
  unless Object.const_defined?(:Mocha)
    require 'mocha'
    require 'stubba'
  end
  yield
rescue LoadError
  $stderr.puts "Skipping #{test_name} tests. `gem install mocha` and try again."
end