diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-06 10:05:51 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-06 10:05:51 +0100 |
commit | df5e1a8e31104b6cb92689c3d82b0c47b77230f1 (patch) | |
tree | bb53c04ed171cf78e63fd82b5c094a2ef2285c45 | |
parent | 7eb6a22e5549d25b95292c23498bd07f44c18fc8 (diff) | |
download | zorglub-df5e1a8e31104b6cb92689c3d82b0c47b77230f1.zip zorglub-df5e1a8e31104b6cb92689c3d82b0c47b77230f1.tar.gz |
fix Config#engine_proc_ext, file engine and spec
-rw-r--r-- | lib/zorglub/config.rb | 2 | ||||
-rw-r--r-- | lib/zorglub/engines/file.rb | 2 | ||||
-rw-r--r-- | spec/node_spec.rb | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/zorglub/config.rb b/lib/zorglub/config.rb index 73e218c..cda71ac 100644 --- a/lib/zorglub/config.rb +++ b/lib/zorglub/config.rb @@ -61,7 +61,7 @@ module Zorglub def engine_proc_ext engine, ext p,x = @engines[engine] return [nil, ''] if p.nil? - [ p, (x.nil? ? ext : x ) ] + [ p, ((ext.nil? or ext.empty?) ? x : ext ) ] end # end diff --git a/lib/zorglub/engines/file.rb b/lib/zorglub/engines/file.rb index fd9fe1e..10f7322 100644 --- a/lib/zorglub/engines/file.rb +++ b/lib/zorglub/engines/file.rb @@ -15,6 +15,6 @@ module Zorglub end end # -Zorglub::Config.register_engine :file, nil, Zorglub::Engines::File.method(:proc) +Zorglub::Config.register_engine :file, 'txt', Zorglub::Engines::File.method(:proc) # # EOF diff --git a/spec/node_spec.rb b/spec/node_spec.rb index 23fd379..701c700 100644 --- a/spec/node_spec.rb +++ b/spec/node_spec.rb @@ -195,9 +195,9 @@ describe Zorglub do # it "ext definition and file engine should work" do r = Node0.my_call '/xml_file' - r.body[0]='<xml>file</xml>' + r.body[0].should == "<xml>file<\/xml>\n" r = Node0.my_call '/plain_file' - r.body[0]='plain text' + r.body[0].should == "plain file\n" end end # |