diff options
| -rw-r--r-- | spec/data/layout/default | 0 | ||||
| -rw-r--r-- | spec/node_spec.rb | 11 | ||||
| -rw-r--r-- | spec/spec_helper.rb | 11 | 
3 files changed, 20 insertions, 2 deletions
| diff --git a/spec/data/layout/default b/spec/data/layout/default new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/spec/data/layout/default diff --git a/spec/node_spec.rb b/spec/node_spec.rb index 845cc11..74eb5e9 100644 --- a/spec/node_spec.rb +++ b/spec/node_spec.rb @@ -48,6 +48,17 @@ describe Zorglub do              r.body[0].should == 'world'          end          # +        it "layout proc, method level layout and engine definitions should work" do +            r = Node0.call( {'PATH_INFO'=>'/index'} ) +            r.status.should == 200 +            h = YAML.load r.body[0] +            ly = File.join Zorglub::Config.root, Zorglub::Config.layout_dir, Node0.layout +            vu = File.join Zorglub::Config.root, Zorglub::Config.view_dir, Node0.r, 'index' +            h['path'].should == ly +            h['layout'].should == ly +            h['view'].should == vu +        end +        #      end      #  end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 3ca9523..1ada235 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -8,20 +8,27 @@ begin  rescue LoadError  end  # +require 'yaml' +#  require 'zorglub'  # -ENGINE_PROC = Proc.new { |path,obj| "path=>#{path} : obj=>#{obj}" } +ENGINE_PROC = Proc.new { |path,obj| {'path'=>path,'layout'=>obj.layout,'view'=>obj.view}.to_yaml } +Zorglub::Config.register_engine 'default', nil, ENGINE_PROC  Zorglub::Config.register_engine 'spec-engine-1', 'spec', ENGINE_PROC  Zorglub::Config.register_engine 'spec-engine-2', 'spec', ENGINE_PROC  # -Zorglub::Config.engine = 'haml' +Zorglub::Config.engine = 'default' +Zorglub::Config.root = File.join Dir.pwd, 'spec', 'data'  #  class Temp < Zorglub::Node  end  #  class Node0 < Zorglub::Node      # default +    def index +    end      def hello +        layout 'none'          'world'      end  end | 
