2007-03-01 19:20:32 -05:00
|
|
|
$:.unshift File.dirname(__FILE__) + "/../lib"
|
|
|
|
$:.unshift File.dirname(__FILE__) + "/../../activesupport/lib"
|
|
|
|
|
|
|
|
require 'test/unit'
|
|
|
|
require 'active_support'
|
2009-09-24 17:01:31 -04:00
|
|
|
require 'rails/initializer'
|
2009-07-02 20:52:46 -04:00
|
|
|
require 'abstract_unit'
|
2007-03-01 19:20:32 -05:00
|
|
|
|
|
|
|
# We need to set RAILS_ROOT if it isn't already set
|
|
|
|
RAILS_ROOT = '.' unless defined?(RAILS_ROOT)
|
2007-11-08 00:29:44 -05:00
|
|
|
|
2007-03-01 19:20:32 -05:00
|
|
|
class Test::Unit::TestCase
|
2007-11-08 00:29:44 -05:00
|
|
|
private
|
|
|
|
def plugin_fixture_root_path
|
2009-04-23 18:58:38 -04:00
|
|
|
File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', 'plugins'))
|
2007-11-08 00:29:44 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def only_load_the_following_plugins!(plugins)
|
|
|
|
@initializer.configuration.plugins = plugins
|
|
|
|
end
|
2007-03-02 18:39:29 -05:00
|
|
|
|
2007-11-08 00:29:44 -05:00
|
|
|
def plugin_fixture_path(path)
|
|
|
|
File.join(plugin_fixture_root_path, path)
|
|
|
|
end
|
|
|
|
|
|
|
|
def assert_plugins(list_of_names, array_of_plugins, message=nil)
|
2009-04-22 22:52:28 -04:00
|
|
|
assert_equal list_of_names.map { |n| n.to_s }, array_of_plugins.map { |p| p.name }, message
|
2007-11-08 00:29:44 -05:00
|
|
|
end
|
2009-04-22 22:52:28 -04:00
|
|
|
end
|