Permalink
Browse files

Update tests fixtures to use a 'DOM' section instead of a 'dom' one t…

…op match more closely what's used in Prototype and thus help identify some template rendering issues.
  • Loading branch information...
1 parent 1d8292b commit e02833d711ec35a79cea697f82391b5b4874d114 @tobie committed Dec 30, 2009
View
8 test/fixtures/ajax.js
@@ -1,7 +1,7 @@
/**
- * == dom ==
+ * == DOM ==
* The DOM section
**/
@@ -20,7 +20,7 @@
**/
-/** section: dom
+/** section: DOM
* class Element
* The Element class
**/
@@ -32,7 +32,7 @@
* the $ function
**/
- /** section: dom
+ /** section: DOM
* $$(selector) -> Array
* the $$ function
**/
@@ -527,7 +527,7 @@ Ajax.PeriodicalUpdater = Klass.create(Ajax.Base, {
});
- /** deprecated, section: dom
+ /** deprecated, section: DOM
* Toggle
**/
View
12 test/fixtures/prototype.js
@@ -51,7 +51,7 @@ if (Prototype.Browser.MobileSafari)
**/
/**
- * == dom ==
+ * == DOM ==
* DOM extensions.
**/
@@ -2062,7 +2062,7 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
this.updater = new Ajax.Updater(this.container, this.url, this.options);
}
});
-/** section: dom
+/** section: DOM
* $(element) -> Element
* $(element...) -> [Element...]
* - element (Element | String): A reference to an existing DOM node _or_ a
@@ -2098,7 +2098,7 @@ if (Prototype.BrowserFeatures.XPath) {
/*--------------------------------------------------------------------------*/
-/** section: dom
+/** section: DOM
* Node
**/
if (!window.Node) var Node = { };
@@ -2121,7 +2121,7 @@ if (!Node.ELEMENT_NODE) {
});
}
-/** section: dom
+/** section: DOM
* class Element
**/
(function() {
@@ -3559,7 +3559,7 @@ Element.addMethods = function(methods) {
if (Element.extend.refresh) Element.extend.refresh();
Element.cache = { };
};
-/** section: dom
+/** section: DOM
* class Element.Layout
**/
Element.Layout = Class.create({
@@ -4106,7 +4106,7 @@ Object.extend(Element.Methods, {
}
});
-/** section: dom
+/** section: DOM
* document.viewport
**/
View
77 test/unit/parser/documentation_test.rb
@@ -36,10 +36,10 @@ def test_mixins
end
def test_sections
- assert_equal %w[ajax dom lang], fixtures.sections.map(&:name)
+ assert_equal %w[DOM ajax lang], fixtures.sections.map(&:name)
assert_equal [Section, Section, Section], fixtures.sections.map(&:class)
- assert_equal %w[Ajax], fixtures.sections.first.children.map(&:name)
- assert_equal %w[Ajax Base Manager Request Responders], fixtures.sections.first.descendants.map(&:name)
+ assert_equal %w[Ajax], fixtures.sections[1].children.map(&:name)
+ assert_equal %w[Ajax Base Manager Request Responders], fixtures.sections[1].descendants.map(&:name)
end
def test_find_by_name
@@ -172,8 +172,8 @@ def test_klass
assert_equal %w[bar foo], fixture.instance_methods.map(&:name)
assert_equal [], fixture.instance_properties
assert_equal %w[$], fixture.related_utilities.map(&:name)
- assert_equal "dom", fixture.doc_parent.name
- assert_equal %w[dom], fixture.ancestors.map(&:name)
+ assert_equal "DOM", fixture.doc_parent.name
+ assert_equal %w[DOM], fixture.ancestors.map(&:name)
assert_equal [], fixture.children
assert_equal [], fixture.descendants
@@ -245,19 +245,19 @@ def test_utilities
assert_equal "", fixture.namespace_string
assert_equal "$", fixture.full_name
assert_equal nil, fixture.klass_name
- assert_equal "dom", fixture.section.name
+ assert_equal "DOM", fixture.section.name
assert_equal fixtures.find_by_name("Element"), fixture.related_to
assert_equal nil, fixture.namespace
assert !fixture.deprecated?
assert !fixture.alias?
- assert_equal "dom", fixture.doc_parent.name
- assert_equal %w[dom], fixture.ancestors.map(&:name)
+ assert_equal "DOM", fixture.doc_parent.name
+ assert_equal %w[DOM], fixture.ancestors.map(&:name)
assert_equal [], fixture.children
assert_equal [], fixture.descendants
fixture = fixtures.find_by_name("$$")
assert_equal Utility, fixture.class
- assert_equal "dom", fixture.section.name
+ assert_equal "DOM", fixture.section.name
assert_equal nil, fixture.related_to
end
@@ -348,14 +348,14 @@ def test_instance_method
assert_equal "Element", fixture.klass_name
assert_equal Klass, fixture.klass.class
assert_equal "Element", fixture.klass.full_name
- assert_equal "dom", fixture.section.name
+ assert_equal "DOM", fixture.section.name
assert_equal Klass, fixture.namespace.class
assert_equal "Element", fixture.namespace.full_name
assert !fixture.deprecated?
assert !fixture.alias?
assert fixture.methodized?
assert_equal "Element", fixture.doc_parent.name
- assert_equal %w[Element dom], fixture.ancestors.map(&:name)
+ assert_equal %w[Element DOM], fixture.ancestors.map(&:name)
assert_equal [], fixture.children
assert_equal [], fixture.descendants
end
@@ -388,7 +388,7 @@ def test_deprecated
assert_equal [], fixture.mixins
assert_equal "Toggle", fixture.name
assert_equal nil, fixture.klass
- assert_equal "dom", fixture.section.name
+ assert_equal "DOM", fixture.section.name
assert_equal "", fixture.namespace_string
assert_equal nil, fixture.namespace
assert fixture.deprecated?
@@ -398,8 +398,8 @@ def test_deprecated
assert_equal [], fixture.instance_methods
assert_equal [], fixture.instance_properties
assert_equal [], fixture.related_utilities
- assert_equal "dom", fixture.doc_parent.name
- assert_equal %w[dom], fixture.ancestors.map(&:name)
+ assert_equal "DOM", fixture.doc_parent.name
+ assert_equal %w[DOM], fixture.ancestors.map(&:name)
assert_equal %w[], fixture.children.map(&:name)
assert_equal %w[], fixture.descendants.map(&:name)
@@ -409,13 +409,13 @@ def test_deprecated
assert_equal "Toggle", fixture.namespace_string
assert_equal "Toggle.display", fixture.full_name
assert_equal nil, fixture.klass_name
- assert_equal "dom", fixture.section.name
+ assert_equal "DOM", fixture.section.name
assert_equal Namespace, fixture.namespace.class
assert_equal "Toggle", fixture.namespace.full_name
assert fixture.deprecated?
assert !fixture.alias?
assert_equal "Toggle", fixture.doc_parent.name
- assert_equal %w[Toggle dom], fixture.ancestors.map(&:name)
+ assert_equal %w[Toggle DOM], fixture.ancestors.map(&:name)
assert_equal [], fixture.children
assert_equal [], fixture.descendants
@@ -425,13 +425,13 @@ def test_deprecated
assert_equal "Toggle", fixture.namespace_string
assert_equal "Toggle.foo", fixture.full_name
assert_equal nil, fixture.klass_name
- assert_equal "dom", fixture.section.name
+ assert_equal "DOM", fixture.section.name
assert_equal Namespace, fixture.namespace.class
assert_equal "Toggle", fixture.namespace.full_name
assert fixture.deprecated?
assert !fixture.alias?
assert_equal "Toggle", fixture.doc_parent.name
- assert_equal %w[Toggle dom], fixture.ancestors.map(&:name)
+ assert_equal %w[Toggle DOM], fixture.ancestors.map(&:name)
assert_equal [], fixture.children
assert_equal [], fixture.descendants
end
@@ -476,4 +476,45 @@ def test_aliases
assert fixture.alias?
assert_equal "foo", fixture.alias_of.name
end
+
+ def test_weird
+ weird = parse(<<-EOS
+
+ /** section: DOM
+ * document
+ *
+ * Prototype extends the built-in `document` object with several convenience
+ * methods related to events.
+ **/
+
+
+ EOS
+ )
+ doc = weird.find_by_name("document")
+ assert_equal 'document', doc.name
+ assert_equal Documentation::Namespace, doc.class
+ end
+
+ def test_weirder
+ weird = parse(<<-EOS
+
+ /**
+ * document.viewport
+ *
+ * The `document.viewport` namespace contains methods that return information
+ * about the viewport &mdash; the rectangle that represents the portion of a web
+ * page within view. In other words, it's the browser window minus all chrome.
+ **/
+
+
+ EOS
+ )
+ doc = weird.find_by_name("document.viewport")
+ assert_equal 'viewport', doc.name
+ assert_equal Documentation::Namespace, doc.class
+ end
+
+ def test_weirdest
+
+ end
end
View
2 website/html/documentation.html
@@ -43,7 +43,7 @@ <h2 id="tags">Tags</h2>
<p>Currently accepted tags are: <code>deprecated</code>, <code>section:</code>, <code>alias of:</code>, <code>related to:</code></p>
-<pre><code>/** deprecated, section: dom, alias of: Element#descendantOf
+<pre><code>/** deprecated, section: DOM, alias of: Element#descendantOf
* Element#childOf(@element, className) -&gt; Element
* ...
**/
View
2 website/markdown/syntax.markdown
@@ -17,7 +17,7 @@ The first line of a comment is reserved for tags. Tags are optional. Tags are se
Currently accepted tags are: `deprecated`, `section:`, `alias of:`, `related to:`
- /** deprecated, section: dom, alias of: Element#descendantOf
+ /** deprecated, section: DOM, alias of: Element#descendantOf
* Element#childOf(@element, className) -> Element
* ...
**/

0 comments on commit e02833d

Please sign in to comment.