lib/ui_helper.rb in test-harness-0.4.7 vs lib/ui_helper.rb in test-harness-0.4.9
- old
+ new
@@ -1,14 +1,17 @@
class TestHarness
class UIHelper
- def self.register_ui_components
- Dir.glob(Rails.root.join(TestHarness.autoload_path, 'ui/*.rb')).each do |file|
+ def self.autoload
+ Dir.glob(File.join(TestHarness.autoload_path, 'ui/*.rb')).each do |file|
component = File.basename(file, '.rb')
- require Rails.root.join(TestHarness.autoload_path, 'ui', component)
- klass = ("TestHarness::%s::%s" % [component.camelize, self.name.split('::').last]).constantize
+ require File.join(TestHarness.autoload_path, 'ui', component)
+ klass = TestHarness::Utilities.constantize("%s::%s::%s" % [
+ TestHarness.namespace,
+ TestHarness::Utilities.camelize(component),
+ self.name.split('::').last
+ ])
TestHarness.register_instance_option(self, component, klass.new)
klass.send(:include, TestHarness::UIComponentHelper)
- klass.send(:include, TestHarness::TestHelper)
end
end
end
-end
+end
\ No newline at end of file