Sha256: 32cde4e3245429278fc45b75a6d219b06252ec6fac31c6cbb740e71b038831a9

Contents?: true

Size: 743 Bytes

Versions: 14

Compression:

Stored size: 743 Bytes

Contents

#          Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

require File.expand_path('../../../spec/helper', __FILE__)

module Ramaze
  module View
    module MyEngine
      def self.call(action, string)
        return string, 'application/x-ruby'
      end
    end

    register View::MyEngine.name, :my
  end
end

class SpecView < Ramaze::Controller
  map '/'
  engine :MyEngine

  def index
    'Hello, World!'
  end
end

describe Ramaze::View do
  behaves_like :rack_test

  it 'uses MyEngine' do
    got = get('/')
    got.status.should == 200
    got['Content-Type'].should == 'application/x-ruby'
    got.body.should == 'Hello, World!'
  end
end

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
Pistos-ramaze-2009.06.12 spec/ramaze/view.rb
manveru-ramaze-2009.07 spec/ramaze/view.rb
ramaze-2011.12.28 spec/ramaze/view.rb
ramaze-2011.10.23 spec/ramaze/view.rb
ramaze-2011.07.25 spec/ramaze/view.rb
ramaze-2011.01.30 spec/ramaze/view.rb
ramaze-2011.01 spec/ramaze/view.rb
ramaze-2010.06.18 spec/ramaze/view.rb
ramaze-2010.04.04 spec/ramaze/view.rb
ramaze-2010.04 spec/ramaze/view.rb
ramaze-2010.03 spec/ramaze/view.rb
ramaze-2010.01 spec/ramaze/view.rb
ramaze-2009.10 spec/ramaze/view.rb
ramaze-2009.07 spec/ramaze/view.rb