-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tmont
committed
Jun 5, 2012
1 parent
eb596b3
commit 15476bd
Showing
5 changed files
with
130 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
var should = require('should'); | ||
var helpers = require('./helpers'); | ||
|
||
describe('DocTypes', function() { | ||
it('at beginning of document', function() { | ||
var docTypeCount = 0; | ||
helpers.parseString('<!doctype html>', { | ||
docType: function(value) { | ||
value.should.equal('html'); | ||
docTypeCount++; | ||
} | ||
}); | ||
|
||
docTypeCount.should.equal(1); | ||
}); | ||
|
||
it('in middle of document', function() { | ||
var docTypeCount = 0, openCount = 0, closeCount = 0; | ||
helpers.parseString('<foo><!doctype html></foo>', { | ||
openElement: function(name) { | ||
name.should.equal('foo'); | ||
openCount++; | ||
}, | ||
closeElement: function(name) { | ||
name.should.equal('foo'); | ||
closeCount++; | ||
}, | ||
docType: function(value) { | ||
openCount.should.equal(1); | ||
closeCount.should.equal(0); | ||
value.should.equal('html'); | ||
docTypeCount++; | ||
} | ||
}); | ||
|
||
docTypeCount.should.equal(1); | ||
openCount.should.equal(1); | ||
closeCount.should.equal(1); | ||
}); | ||
|
||
it('with line breaks', function() { | ||
var docTypeCount = 0; | ||
helpers.parseString('<!doctype foo\nbar>', { | ||
docType: function(value) { | ||
value.should.equal('foo\nbar'); | ||
docTypeCount++; | ||
} | ||
}); | ||
|
||
docTypeCount.should.equal(1); | ||
}); | ||
|
||
it('are case insensitive', function() { | ||
var docTypeCount = 0; | ||
helpers.parseString('<!DoCtyPE html>', { | ||
docType: function(value) { | ||
value.should.equal('html'); | ||
docTypeCount++; | ||
} | ||
}); | ||
|
||
docTypeCount.should.equal(1); | ||
}); | ||
|
||
}); |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!doctype html> | ||
<html> | ||
|
||
<head> | ||
<title>tommy montgomery </title> | ||
<meta http-equiv="content-type" content="text/html;charset=utf-8"/> | ||
<link rel="stylesheet" href="/media/css/global.css"/> | ||
<link rel="shortcut icon" type="image/png" href="/favicon.ico"/> | ||
</head> | ||
|
||
<body> | ||
<div id="wrapper"> | ||
<div id="header"> | ||
<h1><a href="/"><span>t</span>ommy <span>mont</span>gomery</a></h1> | ||
</div> | ||
|
||
<div id="main-content"> | ||
<div id="menu"></div> | ||
|
||
</div> | ||
</div> | ||
|
||
<script src="/media/js/d3.min.js" type="text/javascript"></script> | ||
<script src="/media/js/mainmenu.js" type="text/javascript"></script> | ||
|
||
|
||
<script type="text/javascript"> | ||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); | ||
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); | ||
</script> | ||
<script type="text/javascript"> | ||
try { | ||
var pageTracker = _gat._getTracker("UA-6733824-1"); | ||
pageTracker._trackPageview(); | ||
} | ||
catch (err) { | ||
} | ||
</script> | ||
</body> | ||
|
||
</html> |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require('should'); | ||
var helpers = require('./helpers'); | ||
|
||
describe('Integration', function() { | ||
it('real life HTML document', function() { | ||
|
||
}); | ||
}); |