Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A few more tags. mab5 kernel method. html5_options.
- Loading branch information
1 parent
377fd90
commit 0872596
Showing
5 changed files
with
57 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,60 @@ | ||
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper") | ||
|
||
describe Markaby do | ||
it "inserts an html5 doctype" do | ||
it "should insert an html5 doctype" do | ||
document = mab { html5 { head { title 'OKay' } } } | ||
document.should include("<!DOCTYPE html>") | ||
end | ||
|
||
it "does not have xmlns in html5 html tag" do | ||
it "should not have xmlns in html5 html tag" do | ||
document = mab { html5 { head { title 'OKay' } } } | ||
document.should_not include("xmlns") | ||
end | ||
|
||
it "can make a html5-specific tag" do | ||
it "should make html5-specific tags" do | ||
document = mab { html5 { tag! :header } } | ||
document.should include("header") | ||
end | ||
|
||
it "can accept a html5-specific tag as a block" do | ||
it "should accept html5-specific tag as a block" do | ||
document = mab { html5 { header { h1 "Wow" } } } | ||
document.should include("<header><h1>Wow</h1></header>") | ||
end | ||
|
||
it "html5-specific tags work in partials" do | ||
document = mab { header { h1 "Wow" } } | ||
it "should make html5-specific tags in partials" do | ||
document = mab5 { header { h1 "Wow" } } | ||
document.should include("<header><h1>Wow</h1></header>") | ||
end | ||
|
||
it "puts correct xhtml charset meta" do | ||
it "should put correct xhtml charset meta" do | ||
document = mab { xhtml_strict { head { title 'OKay' } } } | ||
document.should include('<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>') | ||
end | ||
|
||
it "puts correct html5 charset meta" do | ||
it "should put correct html5 charset meta" do | ||
document = mab { html5 { head { title 'OKay' } } } | ||
document.should include('<meta charset="utf-8"/>') | ||
# TODO: sort out the differences in self-closing in HTML5, i.e. | ||
# document.should include('<meta charset="utf-8">') | ||
end | ||
|
||
it "should work fine with a class" do | ||
it "should add a class to a html5 tag" do | ||
document = mab { html5 { canvas.big "yo look" } } | ||
document.should include('<canvas class="big">yo look</canvas>') | ||
end | ||
|
||
it "should work fine with an id" do | ||
it "should add an id to a html5 tag" do | ||
document = mab { html5 { canvas.only! "yo look" } } | ||
document.should include('<canvas id="only">yo look</canvas>') | ||
end | ||
|
||
it "should not add a closing slash to self-closing tags in html5" do | ||
document = mab { html5 { meta :charset => "utf-8" } } | ||
document.should include('<meta charset="utf-8">') | ||
end | ||
|
||
it "should close empty non-self-closing tags in html5" do | ||
document = mab { header } | ||
document.should include("<header></header>") | ||
end | ||
end |