require File.expand_path('../../helper', __FILE__) class PageTest < TestCase setup do @path = fixture('one') @project = Project.new(@path) Dir.chdir @path end test "root" do @page = Page['/'] assert @page.index? assert @page.root? end test "breadcrumbs" do assert_equal %w(/index.html /about/index.css), Page['/about/index.css'].breadcrumbs.map(&:path) assert_equal %w(/index.html /about/index.css /about/us.html), Page['/about/us.html'].breadcrumbs.map(&:path) assert_equal %w(/index.html /css/style.css), Page['/css/style.css'].breadcrumbs.map(&:path) assert_equal %w(/index.html), Page['/'].breadcrumbs.map(&:path) end test "parent" do assert Page['/'].parent.nil? assert Page['/css/style.css'].parent.path == '/index.html' end end