diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-05 14:08:04 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-05 14:08:04 +0100 |
commit | 97dcc225201ff9652cf443c42f8abbcfd9ba86c2 (patch) | |
tree | 79b84047f6c948b206cfbfdb49e8f20e84dc1792 /spec | |
parent | fd6a806405068758210e0472fc1357a248466ef8 (diff) | |
download | zorglub-97dcc225201ff9652cf443c42f8abbcfd9ba86c2.zip zorglub-97dcc225201ff9652cf443c42f8abbcfd9ba86c2.tar.gz |
spec: check class level static definition
Diffstat (limited to 'spec')
-rw-r--r-- | spec/node_spec.rb | 8 | ||||
-rw-r--r-- | spec/spec_helper.rb | 42 |
2 files changed, 27 insertions, 23 deletions
diff --git a/spec/node_spec.rb b/spec/node_spec.rb index 5b5d97d..6c83a13 100644 --- a/spec/node_spec.rb +++ b/spec/node_spec.rb @@ -152,16 +152,16 @@ describe Zorglub do end # it "static pages should be generated" do - r = Node0.my_call '/do_static' + r = Node6.my_call '/do_static' r.body[0].should == 'VAL 1' r.header['Content-type'].should == 'text/static' - r = Node0.my_call '/do_static' + r = Node6.my_call '/do_static' r.body[0].should == 'VAL 1' r.header['Content-type'].should == 'text/static' - r = Node0.my_call '/do_static' + r = Node6.my_call '/do_static' r.body[0].should == 'VAL 1' r.header['Content-type'].should == 'text/static' - r = Node0.my_call '/no_static' + r = Node6.my_call '/no_static' r.body[0].should == 'VAL 4' r.header['Content-type'].should == 'text/static' end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c1e6d64..8d7a9bd 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -45,10 +45,6 @@ class Temp < Zorglub::Node end # class Node0 < Zorglub::Node - @static_cpt=0 - class << self - attr_accessor :static_cpt - end # default def index html @@ -72,21 +68,6 @@ class Node0 < Zorglub::Node def do_redirect redirect r(:do_partial,1,2,3) end - attr_reader :value - def no_static - static false - engine 'static' - view r('do_render') - Node0.static_cpt+=1 - @value = Node0.static_cpt - end - def do_static - static true - engine 'static' - view r('do_render') - Node0.static_cpt+=1 - @value = Node0.static_cpt - end end # class Node1 < Zorglub::Node @@ -144,12 +125,35 @@ class Node5 < Node4 end end # +class Node6 < Zorglub::Node + @static_cpt=0 + class << self + attr_accessor :static_cpt + end + attr_reader :value + static true + def no_static + static false + engine 'static' + view Node0.r('do_render') + Node6.static_cpt+=1 + @value = Node6.static_cpt + end + def do_static + engine 'static' + view Node0.r('do_render') + Node6.static_cpt+=1 + @value = Node6.static_cpt + end +end +# APP = Zorglub::App.new do map '/node0', Node0 map '/node1', Node1 map '/node3', Node3 map '/node4', Node4 map '/node5', Node5 + map '/node6', Node6 end class Node2 map APP, '/node2' |