Sha256: 26192a441de2b99d5d140f5cddf3afe384cbcd0b2ae2cce3b120d3300e73fbfa
Contents?: true
Size: 786 Bytes
Versions: 2
Compression:
Stored size: 786 Bytes
Contents
# Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com # All files in this distribution are subject to the terms of the Ruby license. require 'spec/helper' testcase_requires 'erubis' class TCTemplateErubisController < Ramaze::Controller template_root __DIR__/:erubis engine :Erubis def index 'Erubis Index' end def sum num1, num2 @num1, @num2 = num1.to_i, num2.to_i end def inline *args @args = args "<%= @args.inspect %>" end end describe "Erubis" do ramaze(:mapping => {'/' => TCTemplateErubisController}) it "index" do get('/').body.should == 'Erubis Index' end it "sum" do get('/sum/1/2').body.strip.should == '3' end it "inline" do get('/inline/foo/bar').body.should == %w[foo bar].inspect end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ramaze-0.2.1 | spec/ramaze/template/erubis.rb |
ramaze-0.2.0 | spec/ramaze/template/erubis.rb |