diff --git a/test/benchmark.rb b/test/benchmark.rb index 14055314..c08f59c8 100755 --- a/test/benchmark.rb +++ b/test/benchmark.rb @@ -12,6 +12,7 @@ END end require File.dirname(__FILE__) + '/../lib/haml' +require File.dirname(__FILE__) + '/linked_rails' %w[sass rubygems erb erubis markaby active_support action_controller action_view haml/template].each(&method(:require)) diff --git a/test/linked_rails.rb b/test/linked_rails.rb new file mode 100644 index 00000000..7429f58d --- /dev/null +++ b/test/linked_rails.rb @@ -0,0 +1,12 @@ +# allows testing with edge Rails by creating a test/rails symlink +linked_rails = File.dirname(__FILE__) + '/rails' + +if File.exists?(linked_rails) && !$:.include?(linked_rails + '/activesupport/lib') + puts "[ using linked Rails ]" + $:.unshift linked_rails + '/activesupport/lib' + $:.unshift linked_rails + '/actionpack/lib' +else + require 'rubygems' +end +require 'action_controller' +require 'action_view' diff --git a/test/test_helper.rb b/test/test_helper.rb index 1d5e3107..f15fe129 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,16 +1,5 @@ lib_dir = File.dirname(__FILE__) + '/../lib' -# allows testing with edge Rails by creating a test/rails symlink -linked_rails = File.dirname(__FILE__) + '/rails' - -if File.exists?(linked_rails) && !$:.include?(linked_rails + '/activesupport/lib') - puts "[ using linked Rails ]" - $:.unshift linked_rails + '/activesupport/lib' - $:.unshift linked_rails + '/actionpack/lib' -else - require 'rubygems' -end -require 'action_controller' -require 'action_view' +require File.dirname(__FILE__) + '/linked_rails' require 'test/unit' $:.unshift lib_dir unless $:.include?(lib_dir) @@ -21,4 +10,4 @@ require 'sass' unless defined? RAILS_ROOT RAILS_ROOT = '.' MERB_ENV = RAILS_ENV = 'testing' -end \ No newline at end of file +end