diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/data/view/node0/engines.scss | 9 | ||||
-rw-r--r-- | spec/node_spec.rb | 5 | ||||
-rw-r--r-- | spec/spec_helper.rb | 4 |
3 files changed, 18 insertions, 0 deletions
diff --git a/spec/data/view/node0/engines.scss b/spec/data/view/node0/engines.scss new file mode 100644 index 0000000..a3020dc --- /dev/null +++ b/spec/data/view/node0/engines.scss @@ -0,0 +1,9 @@ +vbar { + width: 80%; + height: 23px; + ul { list-style-type: none; } + li { + float: left; + a { font-weight: bold; } + } +} diff --git a/spec/node_spec.rb b/spec/node_spec.rb index 98e7f99..a203ef7 100644 --- a/spec/node_spec.rb +++ b/spec/node_spec.rb @@ -232,6 +232,11 @@ describe Zorglub do r.body[0].should == "<h1>Hello world</h1>\n" end # + it "sass engine should work" do + r = Node0.my_call '/engines/sass' + r.body[0].should == "vbar{width:80%;height:23px}vbar ul{list-style-type:none}vbar li{float:left}vbar li a{font-weight:bold}\n" + end + # it "view_base_path! should work" do r = Node7.my_call '/view_path' h = YAML.load r.body[0] diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 660bd39..ee4596e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -13,6 +13,7 @@ require 'yaml' require 'zorglub' require 'zorglub/engines/file' require 'zorglub/engines/haml' +require 'zorglub/engines/sass' # HASH_PROC = Proc.new { |path,obj| {:path=>path,:layout=>obj.layout,:view=>obj.view,:args=>obj.args,:map=>obj.map}.to_yaml } STATIC_PROC = Proc.new { |path,obj| ["VAL #{obj.value}",'text/static'] } @@ -78,6 +79,8 @@ class Node0 < Zorglub::Node case name when 'haml' engine! :haml + when 'sass' + engine! :sass end end end @@ -172,6 +175,7 @@ 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! :sass, 'scss', Zorglub::Engines::Sass.method(:proc) register_engine! 'default', nil, HASH_PROC register_engine! 'engine-1', 'spec', HASH_PROC register_engine! 'engine-2', 'spec', HASH_PROC |