test/test_generator_helper.rb in newgem-0.23.1 vs test/test_generator_helper.rb in newgem-0.24.0
- old
+ new
@@ -1,15 +1,24 @@
-require File.dirname(__FILE__) + '/test_helper'
+begin
+ require File.dirname(__FILE__) + '/test_helper'
+rescue LoadError
+ require 'test/unit'
+end
require 'fileutils'
# Must set before requiring generator libs.
TMP_ROOT = File.dirname(__FILE__) + "/tmp" unless defined?(TMP_ROOT)
PROJECT_NAME = "myproject" unless defined?(PROJECT_NAME)
app_root = File.join(TMP_ROOT, PROJECT_NAME)
if defined?(APP_ROOT)
APP_ROOT.replace(app_root)
else
APP_ROOT = app_root
+end
+if defined?(RAILS_ROOT)
+ RAILS_ROOT.replace(app_root)
+else
+ RAILS_ROOT = app_root
end
begin
require 'rubigen'
rescue LoadError