summaryrefslogtreecommitdiffstats
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-01-17 13:54:04 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2012-01-17 13:54:04 +0100
commit4ede655abcd1fd3a0e7981759720a4243a744c88 (patch)
treeea2573fb1605cfbac84f93db4e8374a52351b04c /spec/spec_helper.rb
parent641e342d797b0f22bd0496ea460b9ac87f10d24a (diff)
downloadzorglub-4ede655abcd1fd3a0e7981759720a4243a744c88.zip
zorglub-4ede655abcd1fd3a0e7981759720a4243a744c88.tar.gz
App swallows Config
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb24
1 files changed, 13 insertions, 11 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 78ce08f..660bd39 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -28,14 +28,7 @@ RENDER_PROC = Proc.new { |path,obj|
raise Exception.new
end
}
-Zorglub::Config.register_engine 'default', nil, HASH_PROC
-Zorglub::Config.register_engine 'engine-1', 'spec', HASH_PROC
-Zorglub::Config.register_engine 'engine-2', 'spec', HASH_PROC
-Zorglub::Config.register_engine 'real', nil, RENDER_PROC
-Zorglub::Config.register_engine 'static', nil, STATIC_PROC
-#
-Zorglub::Config[:engine] = 'default'
-Zorglub::Config.root = File.join Dir.pwd, 'spec', 'data'
+APP_ROOT = File.join Dir.pwd, 'spec', 'data'
#
class Zorglub::Node
def self.my_call uri
@@ -169,15 +162,23 @@ class Node6 < Zorglub::Node
end
#
class Node7 < Zorglub::Node
- layout_base_path! File.join Zorglub::Config.root, 'alt','layout'
- view_base_path! File.join Zorglub::Config.root, 'alt'
+ layout_base_path! File.join APP_ROOT, 'alt','layout'
+ view_base_path! File.join APP_ROOT, 'alt'
def view_path
view! 'do_render'
end
end
-
#
APP = Zorglub::App.new do
+ register_engine! :file, nil, Zorglub::Engines::File.method(:proc)
+ register_engine! :haml, 'haml', Zorglub::Engines::Haml.method(:proc)
+ register_engine! 'default', nil, HASH_PROC
+ register_engine! 'engine-1', 'spec', HASH_PROC
+ register_engine! 'engine-2', 'spec', HASH_PROC
+ register_engine! 'real', nil, RENDER_PROC
+ register_engine! 'static', nil, STATIC_PROC
+ opt! :root, APP_ROOT
+ opt! :engine, 'default'
map '/node0', Node0
map '/node1', Node1
map '/node3', Node3
@@ -187,6 +188,7 @@ APP = Zorglub::App.new do
map '/node7', Node7
map '/node8', Node8
end
+#
class Node2
map APP, '/node2'
end