Sha256: 402a13ea03750d9f8416c54541773e4baf4d00c21e53e59c57a11b53c1713fab

Contents?: true

Size: 1.21 KB

Versions: 4

Compression:

Stored size: 1.21 KB

Contents

$START_OPTIONS = {:merb_root => File.join(File.dirname(__FILE__), "directory")}
require File.join(File.dirname(__FILE__), "..", "..", "spec_helper")

describe "The default Merb directory structure" do

  it "should load in controllers" do
    calling { Base }.should_not raise_error
  end

  it "should be able to complete the dispatch cycle" do
    controller = dispatch_to(Base, :string)
    controller.body.should == "String"
  end

  it "should be able to complete the dispatch cycle with templates" do
    controller = dispatch_to(Base, :template)
    controller.body.should == "Template ERB"
  end

end

describe "Modifying the _template_path" do

  it "should move the templates to a new location" do
    controller = dispatch_to(Custom, :template)
    controller.body.should == "Wonderful Template"
  end

end

describe "Merb.root_path" do

  it "should return a path relative to Merb.root" do
    path = Merb.root_path('/app/controllers/base.rb')
    path.to_s.should == File.join(Merb.root, '/app/controllers/base.rb')
  end

  it "should accept multiple arguments like File.join" do
    path = Merb.root_path('app', 'controllers', 'base.rb')
    path.to_s.should == File.join(Merb.root, 'app', 'controllers', 'base.rb')
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
merb-core-0.9.4 spec/public/directory_structure/directory_spec.rb
merb-core-0.9.5 spec/public/directory_structure/directory_spec.rb
merb-core-0.9.6 spec/public/directory_structure/directory_spec.rb
merb-core-0.9.7 spec/public/directory_structure/directory_spec.rb