Sha256: 34033711ec5cc9cd9b0d94b03a3fb2e3e88dc63fe9502147c1d063eac3efc3da

Contents?: true

Size: 1011 Bytes

Versions: 29

Compression:

Stored size: 1011 Bytes

Contents

require 'awestruct/layouts'
require 'awestruct/page'
require 'awestruct/handlers/file_handler'
require 'awestruct/handlers/tilt_handler'

require 'hashery'

describe Awestruct::Layouts do

  it "should be able to index layouts by simple name and output extension" do
    dir = Pathname.new( test_data_dir 'handlers' )
    site = Hashery::OpenCascade[ { :dir=>dir } ]
    file_handler = Awestruct::Handlers::FileHandler.new( site, File.join( dir, 'haml-layout.html.haml' ) )
    haml_handler = Awestruct::Handlers::TiltHandler.new( site, file_handler )
    page = Awestruct::Page.new( nil, haml_handler )
    
    layouts = Awestruct::Layouts.new
    layouts << page

    located = layouts[0]
    located.should_not be_nil
    located.class.should == Awestruct::Page
    located.simple_name.should == 'haml-layout'

    located = layouts.find_matching( 'haml-layout', '.html' )
    located.should_not be_nil
    located.class.should == Awestruct::Page
    located.simple_name.should == 'haml-layout'
  end

end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
awestruct-0.6.7 spec/awestruct/layouts_spec.rb
awestruct-0.6.6 spec/awestruct/layouts_spec.rb
awestruct-0.6.5 spec/awestruct/layouts_spec.rb
awestruct-0.6.4 spec/awestruct/layouts_spec.rb
awestruct-0.6.3 spec/awestruct/layouts_spec.rb
awestruct-0.6.2 spec/awestruct/layouts_spec.rb
awestruct-0.6.1 spec/awestruct/layouts_spec.rb
awestruct-0.6.0 spec/awestruct/layouts_spec.rb
awestruct-0.6.0.RC1 spec/awestruct/layouts_spec.rb
awestruct-0.6.0.alpha4 spec/awestruct/layouts_spec.rb
awestruct-0.6.0.alpha3 spec/awestruct/layouts_spec.rb
awestruct-0.6.0.alpha1 spec/awestruct/layouts_spec.rb
awestruct-0.5.7 spec/awestruct/layouts_spec.rb
awestruct-0.5.7.RC2 spec/awestruct/layouts_spec.rb
awestruct-0.5.7.RC1 spec/awestruct/layouts_spec.rb
awestruct-0.5.6 spec/awestruct/layouts_spec.rb
awestruct-0.5.6.beta9 spec/awestruct/layouts_spec.rb
awestruct-0.5.6.beta8 spec/awestruct/layouts_spec.rb
awestruct-0.5.6.beta7 spec/awestruct/layouts_spec.rb
awestruct-0.5.6.beta6 spec/awestruct/layouts_spec.rb