1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

[Haml] Support loading of Rails plugins for testing.

This commit is contained in:
Nathan Weizenbaum 2009-10-15 23:12:41 -07:00
parent 6f33bce585
commit c83b358f56
2 changed files with 11 additions and 0 deletions

View file

@ -25,6 +25,7 @@ Rake::TestTask.new do |t|
t.libs << 'lib'
test_files = FileList['test/**/*_test.rb']
test_files.exclude('test/rails/*')
test_files.exclude('test/plugins/*')
test_files.exclude('test/haml/spec/*')
t.test_files = test_files
t.verbose = true

View file

@ -10,3 +10,13 @@ else
end
require 'action_controller'
require 'action_view'
ActionController::Base.logger = Logger.new(nil)
# Load plugins from test/plugins.
# This will only work with very basic plugins,
# since we don't want to load the entirety of Rails.
Dir[File.dirname(__FILE__) + '/plugins/*'].each do |plugin|
$: << plugin + '/lib'
Object.new.instance_eval(File.read(plugin + '/init.rb'))
end