summaryrefslogtreecommitdiffstats
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index aa096e7..5763a8c 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -13,9 +13,21 @@ require 'yaml'
require 'zorglub'
#
HASH_PROC = Proc.new { |path,obj| {:path=>path,:layout=>obj.layout,:view=>obj.view,:args=>obj.args}.to_yaml }
+RENDER_PROC = Proc.new { |path,obj|
+ m = obj.action[:mode]
+ case m
+ when :layout
+ "layout_start #{obj.content} layout_end"
+ when :view
+ "view_content"
+ else
+ 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[:engine] = 'default'
Zorglub::Config.root = File.join Dir.pwd, 'spec', 'data'
@@ -34,6 +46,9 @@ class Node0 < Zorglub::Node
end
def with_2args a1, a2
end
+ def do_render
+ engine 'real'
+ end
end
#
class Node1 < Zorglub::Node