aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/abstract_unit.rb
blob: e1ce32da65b877c202d7bbb90ca5d940e3701f74 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$:.unshift File.dirname(__FILE__) + "/../../activesupport/lib"
$:.unshift File.dirname(__FILE__) + "/../../actionpack/lib"
$:.unshift File.dirname(__FILE__) + "/../lib"
$:.unshift File.dirname(__FILE__) + "/../builtin/rails_info"

require 'test/unit'
require 'stringio'
require 'active_support'

# Wrap tests that use Mocha and skip if unavailable.
def uses_mocha(test_name)
  require 'rubygems'
  gem 'mocha', '>= 0.5.5'
  require 'mocha'
  yield
rescue LoadError
  $stderr.puts "Skipping #{test_name} tests. `gem install mocha` and try again."
end

if defined?(RAILS_ROOT)
  RAILS_ROOT.replace File.dirname(__FILE__)
else
  RAILS_ROOT = File.dirname(__FILE__)
end