require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe Garterbelt::Doctype do before :all do @view = MockView.new end describe 'basics' do it 'is decends from ClosedTag' do Garterbelt::Doctype.ancestors.should include Garterbelt::ClosedTag end it 'has a smaller pool size' do Garterbelt::Doctype._pool.max_size.should == 1000 end end describe 'render' do before do @view = MockView.new @doctype = Garterbelt::Doctype.new(:view => @view, :type => :transitional) end it 'builds the right tag for type = :transitional' do tag = "" @doctype.render.should include tag end it 'builds the right tag for type = :strict' do tag = '' @doctype.type = :strict @doctype.render.should include tag end it 'builds the right tag for type = :html5' do tag = '' @doctype.type = :html5 @doctype.render.should include tag end it 'indents to the view level' do @doctype.render @view.output.should match /^\W{4}