diff options
| author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-16 15:40:34 +0100 | 
|---|---|---|
| committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-16 15:40:34 +0100 | 
| commit | 66501cb0e23f40ea5ae1fe6185b23ffcb3d55de4 (patch) | |
| tree | e72525afdd2390f6014bce8046595d49e448de1a /spec | |
| parent | d88ac85cebf1a5f0271c490063eefd693e1aa7d1 (diff) | |
| download | zorglub-66501cb0e23f40ea5ae1fe6185b23ffcb3d55de4.zip zorglub-66501cb0e23f40ea5ae1fe6185b23ffcb3d55de4.tar.gz  | |
add view_base_path! specs
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/node_spec.rb | 6 | ||||
| -rw-r--r-- | spec/spec_helper.rb | 10 | 
2 files changed, 16 insertions, 0 deletions
diff --git a/spec/node_spec.rb b/spec/node_spec.rb index 5c3e2e2..66ff114 100644 --- a/spec/node_spec.rb +++ b/spec/node_spec.rb @@ -209,6 +209,12 @@ describe Zorglub do              r.body[0].should == "<h1>Hello world</h1>\n"          end          # +        it "view_base_path! should work" do +            r = Node7.my_call '/view_path' +            h = YAML.load r.body[0] +            h[:view].should == File.join(Zorglub::Config.root, 'alt/do_render') +        end +        #      end      #  end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6a71ef4..4a5a9b2 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -165,6 +165,15 @@ class Node6 < Zorglub::Node      end  end  # +class Node7 < Zorglub::Node +    Zorglub::Config.debug=true +    view_base_path! File.join Zorglub::Config.root, 'alt' +    def view_path +        view! 'do_render' +    end +end + +#  APP = Zorglub::App.new do      map '/node0', Node0      map '/node1', Node1 @@ -172,6 +181,7 @@ APP = Zorglub::App.new do      map '/node4', Node4      map '/node5', Node5      map '/node6', Node6 +    map '/node7', Node7  end  class Node2      map APP, '/node2'  | 
