X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=vendor%2Frails%2Factionpack%2Ftest%2Fabstract_unit.rb;fp=vendor%2Frails%2Factionpack%2Ftest%2Fabstract_unit.rb;h=673efa6af090d3046a2b65ca71482d959ce68631;hb=d115f2e23823271635bad69229a42cd8ac68debe;hp=0000000000000000000000000000000000000000;hpb=37cb670bf3ddde90b214e591f100ed4446469484;p=depot.git diff --git a/vendor/rails/actionpack/test/abstract_unit.rb b/vendor/rails/actionpack/test/abstract_unit.rb new file mode 100644 index 0000000..673efa6 --- /dev/null +++ b/vendor/rails/actionpack/test/abstract_unit.rb @@ -0,0 +1,39 @@ +$:.unshift(File.dirname(__FILE__) + '/../lib') +$:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib') +$:.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 'action_view/test_case' + +begin + require 'ruby-debug' +rescue LoadError + # Debugging disabled. `gem install ruby-debug` to enable. +end + +# Show backtraces for deprecated behavior for quicker cleanup. +ActiveSupport::Deprecation.debug = true + +ActionController::Base.logger = nil +ActionController::Routing::Routes.reload rescue nil + +FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures') +ActionView::PathSet::Path.eager_load_templates! +ActionController::Base.view_paths = FIXTURE_LOAD_PATH + +# 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 => load_error + raise unless load_error.message =~ /mocha/i + $stderr.puts "Skipping #{test_name} tests. `gem install mocha` and try again." +end