Sha256: 5b01e2349673422c62f74d78d519f9ee4c794c079fda50f232653ef2d6995b63

Contents?: true

Size: 701 Bytes

Versions: 10

Compression:

Stored size: 701 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 'spec/helper'

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 :mock

  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

10 entries across 10 versions & 3 rubygems

Version Path
Pistos-ramaze-2009.04.08 spec/ramaze/view.rb
manveru-ramaze-2009.04.01 spec/ramaze/view.rb
manveru-ramaze-2009.04.08 spec/ramaze/view.rb
manveru-ramaze-2009.04.18 spec/ramaze/view.rb
manveru-ramaze-2009.04.22 spec/ramaze/view.rb
manveru-ramaze-2009.04 spec/ramaze/view.rb
manveru-ramaze-2009.05.08 spec/ramaze/view.rb
manveru-ramaze-2009.05 spec/ramaze/view.rb
ramaze-2009.04 spec/ramaze/view.rb
ramaze-2009.05 spec/ramaze/view.rb