aboutsummaryrefslogtreecommitdiffstats
path: root/docs/spec/ngdocSpec.js
diff options
context:
space:
mode:
authorVojta Jina2011-05-24 00:49:33 +0200
committerIgor Minar2011-06-06 22:52:01 -0700
commit2da07127e45312ce22d894aa771b8797e9a301a1 (patch)
treecc588b8fbdb5792c908b2b216bc9b9ab12c84663 /docs/spec/ngdocSpec.js
parentd05e83992023c0aa8c663ac187529abf45dfe533 (diff)
downloadangular.js-2da07127e45312ce22d894aa771b8797e9a301a1.tar.bz2
Add doc:tutorial-instructions widget
Diffstat (limited to 'docs/spec/ngdocSpec.js')
-rw-r--r--docs/spec/ngdocSpec.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/spec/ngdocSpec.js b/docs/spec/ngdocSpec.js
index 7ad364c0..e4e21e25 100644
--- a/docs/spec/ngdocSpec.js
+++ b/docs/spec/ngdocSpec.js
@@ -165,11 +165,38 @@ describe('ngdoc', function(){
'<p>asdf x</p>');
});
+ it('should ignore doc widgets', function() {
+ expect(new Doc().markdown('text<doc:example>do not touch</doc:example>')).
+ toEqual('<p>text</p><doc:example>do not touch</doc:example>');
+
+ expect(new Doc().markdown('text<doc:tutorial-instructions>do not touch</doc:tutorial-instructions>')).
+ toEqual('<p>text</p><doc:tutorial-instructions>do not touch</doc:tutorial-instructions>');
+ });
+
+ it('should ignore doc widgets with params', function() {
+ expect(new Doc().markdown('text<doc:tutorial-instructions id="10" show="true">do not touch</doc:tutorial-instructions>')).
+ toEqual('<p>text</p><doc:tutorial-instructions id="10" show="true">do not touch</doc:tutorial-instructions>');
+ });
+
it('should replace text between two <pre></pre> tags', function() {
expect(new Doc().markdown('<pre>x</pre># One<pre>b</pre>')).
toMatch('</div><h1>One</h1><div');
});
+ it('should ignore nested doc widgets', function() {
+ expect(new Doc().markdown(
+ 'before<doc:tutorial-instructions>\n' +
+ '<doc:tutorial-instruction id="git-mac" name="Git on Mac/Linux">' +
+ '\ngit bla bla\n</doc:tutorial-instruction>\n' +
+ '</doc:tutorial-instructions>')).toEqual(
+
+ '<p>before</p><doc:tutorial-instructions>\n' +
+ '<doc:tutorial-instruction id="git-mac" name="Git on Mac/Linux">\n' +
+ 'git bla bla\n' +
+ '</doc:tutorial-instruction>\n' +
+ '</doc:tutorial-instructions>');
+ });
+
it('should unindent text before processing based on the second line', function() {
expect(new Doc().markdown('first line\n' +
' second line\n\n' +