Sha256: ac89a15abf752b5bca63ee777acd9917931c8ef3f44707f0063b32f29fe74853

Contents?: true

Size: 800 Bytes

Versions: 10

Compression:

Stored size: 800 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'

spec_require 'erubis'

class TCTemplateErubisController < Ramaze::Controller
  view_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
  behaves_like 'http'
  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

10 entries across 10 versions & 4 rubygems

Version Path
Pistos-ramaze-2008.12 spec/ramaze/template/erubis.rb
Pistos-ramaze-2009.01 spec/ramaze/template/erubis.rb
Pistos-ramaze-2009.02 spec/ramaze/template/erubis.rb
manveru-ramaze-2008.12 spec/ramaze/template/erubis.rb
manveru-ramaze-2009.01 spec/ramaze/template/erubis.rb
ptomato-ramaze-2009.02.1 spec/ramaze/template/erubis.rb
ptomato-ramaze-2009.02 spec/ramaze/template/erubis.rb
ramaze-2009.01 spec/ramaze/template/erubis.rb
ramaze-2009.03 spec/ramaze/template/erubis.rb
ramaze-2009.02 spec/ramaze/template/erubis.rb