Skip to content
This repository
Browse code

Add aliases documentation to the readme

  • Loading branch information...
commit 65aa88118d752b4bf41f3747005c454d835bcbd7 1 parent 9a7bc5d
Veena Basavaraj authored March 20, 2012

Showing 188 changed files with 51,071 additions and 0 deletions. Show diff stats Hide diff stats

  1. 53  README.md
  2. 0  c/w b/node_modules/jasmine-node/node_modules/findit/test/foo/a/b/c/w
  3. 1  node_modules/.bin/jasmine-node
  4. 1  node_modules/jasmine-node/.idea/.name
  5. 12  node_modules/jasmine-node/.npmignore
  6. 22  node_modules/jasmine-node/LICENSE
  7. 56  node_modules/jasmine-node/README.md
  8. 7  node_modules/jasmine-node/bin/jasmine-node
  9. 41  node_modules/jasmine-node/lib/jasmine-node/async-callback.js
  10. 86  node_modules/jasmine-node/lib/jasmine-node/autotest.js
  11. 182  node_modules/jasmine-node/lib/jasmine-node/cli.js
  12. 148  node_modules/jasmine-node/lib/jasmine-node/index.js
  13. 2,479  node_modules/jasmine-node/lib/jasmine-node/jasmine-2.0.0.rc1.js
  14. 275  node_modules/jasmine-node/lib/jasmine-node/reporter.js
  15. 70  node_modules/jasmine-node/lib/jasmine-node/requirejs-runner.js
  16. 48  node_modules/jasmine-node/lib/jasmine-node/requirejs-spec-loader.js
  17. 65  node_modules/jasmine-node/lib/jasmine-node/requirejs-wrapper-template.js
  18. 36  node_modules/jasmine-node/lib/jasmine-node/spec-collection.js
  19. 1  node_modules/jasmine-node/node_modules/.bin/cake
  20. 1  node_modules/jasmine-node/node_modules/.bin/coffee
  21. 1  node_modules/jasmine-node/node_modules/.bin/r.js
  22. 11  node_modules/jasmine-node/node_modules/coffee-script/.npmignore
  23. 22  node_modules/jasmine-node/node_modules/coffee-script/LICENSE
  24. 51  node_modules/jasmine-node/node_modules/coffee-script/README
  25. 78  node_modules/jasmine-node/node_modules/coffee-script/Rakefile
  26. 7  node_modules/jasmine-node/node_modules/coffee-script/bin/cake
  27. 7  node_modules/jasmine-node/node_modules/coffee-script/bin/coffee
  28. 44  node_modules/jasmine-node/node_modules/coffee-script/extras/jsl.conf
  29. 74  node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/browser.js
  30. 99  node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/cake.js
  31. 150  node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/coffee-script.js
  32. 442  node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/command.js
  33. 592  node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/grammar.js
  34. 72  node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/helpers.js
  35. 10  node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/index.js
  36. 686  node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/lexer.js
  37. 2,514  node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/nodes.js
  38. 122  node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/optparse.js
  39. 674  node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/parser.js
  40. 149  node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/repl.js
  41. 301  node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/rewriter.js
  42. 124  node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/scope.js
  43. 31  node_modules/jasmine-node/node_modules/coffee-script/package.json
  44. 101  node_modules/jasmine-node/node_modules/findit/README.markdown
  45. 3  node_modules/jasmine-node/node_modules/findit/examples/callback.js
  46. 9  node_modules/jasmine-node/node_modules/findit/examples/emitter.js
  47. 2  node_modules/jasmine-node/node_modules/findit/examples/sync.js
  48. 142  node_modules/jasmine-node/node_modules/findit/index.js
  49. 1  node_modules/jasmine-node/node_modules/findit/node_modules/seq/.npmignore
  50. 442  node_modules/jasmine-node/node_modules/findit/node_modules/seq/README.markdown
  51. 18  node_modules/jasmine-node/node_modules/findit/node_modules/seq/examples/join.js
  52. 12  node_modules/jasmine-node/node_modules/findit/node_modules/seq/examples/parseq.coffee
  53. 19  node_modules/jasmine-node/node_modules/findit/node_modules/seq/examples/parseq.js
  54. 16  node_modules/jasmine-node/node_modules/findit/node_modules/seq/examples/stat_all.coffee
  55. 17  node_modules/jasmine-node/node_modules/findit/node_modules/seq/examples/stat_all.js
  56. 520  node_modules/jasmine-node/node_modules/findit/node_modules/seq/index.js
  57. 1  node_modules/jasmine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/.npmignore
  58. 140  node_modules/jasmine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/README.markdown
  59. 25  node_modules/jasmine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/examples/add_do.js
  60. 67  node_modules/jasmine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/examples/prompt.js
  61. 108  node_modules/jasmine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/index.js
  62. 1  ...es/jasmine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/.npmignore
  63. 24  ...dules/jasmine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/LICENSE
  64. 247  ...smine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/README.markdown
  65. 16  ...mine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/examples/json.js
  66. 15  ...ne-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/examples/leaves.js
  67. 8  ...-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/examples/negative.js
  68. 38  ...node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/examples/stringify.js
  69. 322  ...ules/jasmine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/index.js
  70. 18  .../jasmine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/package.json
  71. 114  ...mine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/circular.js
  72. 35  .../jasmine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/date.js
  73. 219  ...jasmine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/equal.js
  74. 17  ...mine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/instance.js
  75. 42  ...ine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/interface.js
  76. 47  .../jasmine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/json.js
  77. 21  ...asmine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/leaves.js
  78. 203  ...ne-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/mutability.js
  79. 20  ...mine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/negative.js
  80. 15  ...s/jasmine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/obj.js
  81. 41  .../jasmine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/stop.js
  82. 36  ...ine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/stringify.js
  83. 54  ...ne-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/super_deep.js
  84. 23  node_modules/jasmine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/package.json
  85. 418  node_modules/jasmine-node/node_modules/findit/node_modules/seq/node_modules/chainsaw/test/chainsaw.js
  86. 191  node_modules/jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/README.markdown
  87. 9  node_modules/jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/examples/chain.js
  88. 7  node_modules/jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/examples/map.js
  89. 253  node_modules/jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/index.js
  90. 1  ...les/jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/.npmignore
  91. 24  ...odules/jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/LICENSE
  92. 256  ...asmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/README.markdown
  93. 16  ...smine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/json.js
  94. 15  ...ine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/leaves.js
  95. 8  ...e-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/negative.js
  96. 10  ...mine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/scrub.js
  97. 38  ...-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/stringify.js
  98. 279  ...dules/jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/index.js
  99. 18  ...s/jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/package.json
  100. 115  ...smine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/circular.js
  101. 35  ...s/jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/date.js
  102. 220  .../jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/equal.js
  103. 13  ...es/jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/has.js
  104. 17  ...smine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/instance.js
  105. 42  ...mine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/interface.js
  106. 47  ...s/jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/json.js
  107. 29  ...s/jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/keys.js
  108. 21  ...jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/leaves.js
  109. 92  ...node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/lib/deep_equal.js
  110. 252  ...ine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/mutability.js
  111. 20  ...smine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/negative.js
  112. 15  ...es/jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/obj.js
  113. 35  ...smine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/siblings.js
  114. 41  ...s/jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/stop.js
  115. 36  ...mine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/stringify.js
  116. 34  ...asmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/subexpr.js
  117. 55  ...ine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/super_deep.js
  118. 22  ...ine-node/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/testling/leaves.js
  119. 33  node_modules/jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/package.json
  120. 250  node_modules/jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/test/hash.js
  121. 69  node_modules/jasmine-node/node_modules/findit/node_modules/seq/node_modules/hashish/test/property.js
  122. 33  node_modules/jasmine-node/node_modules/findit/node_modules/seq/package.json
  123. 35  node_modules/jasmine-node/node_modules/findit/node_modules/seq/test/readdir.js
  124. 946  node_modules/jasmine-node/node_modules/findit/node_modules/seq/test/seq.js
  125. 149  node_modules/jasmine-node/node_modules/findit/node_modules/seq/test/seq_.js
  126. 34  node_modules/jasmine-node/node_modules/findit/package.json
  127. 31  node_modules/jasmine-node/node_modules/findit/test/cb.js
  128. 79  node_modules/jasmine-node/node_modules/findit/test/foo.js
  129. 0  node_modules/jasmine-node/node_modules/findit/test/foo/a/y
  130. 0  node_modules/jasmine-node/node_modules/findit/test/foo/x
  131. 29  node_modules/jasmine-node/node_modules/findit/test/module.js
  132. 73  node_modules/jasmine-node/node_modules/findit/test/symlinks.js
  133. 1  node_modules/jasmine-node/node_modules/findit/test/symlinks/dir1/dangling-symlink
  134. 0  node_modules/jasmine-node/node_modules/findit/test/symlinks/dir1/file1
  135. 0  node_modules/jasmine-node/node_modules/findit/test/symlinks/dir2/file2
  136. 0  node_modules/jasmine-node/node_modules/findit/test/symlinks/file
  137. 2  node_modules/jasmine-node/node_modules/jasmine-reporters/.npmignore
  138. 21  node_modules/jasmine-node/node_modules/jasmine-reporters/LICENSE
  139. 52  node_modules/jasmine-node/node_modules/jasmine-reporters/README.markdown
  140. 13,989  node_modules/jasmine-node/node_modules/jasmine-reporters/ext/env.rhino.1.2.js
  141. 182  node_modules/jasmine-node/node_modules/jasmine-reporters/ext/jasmine-html.js
  142. 166  node_modules/jasmine-node/node_modules/jasmine-reporters/ext/jasmine.css
  143. 2,421  node_modules/jasmine-node/node_modules/jasmine-reporters/ext/jasmine.js
  144. BIN  node_modules/jasmine-node/node_modules/jasmine-reporters/ext/jline.jar
  145. BIN  node_modules/jasmine-node/node_modules/jasmine-reporters/ext/js.jar
  146. 15  node_modules/jasmine-node/node_modules/jasmine-reporters/package.json
  147. 142  node_modules/jasmine-node/node_modules/jasmine-reporters/src/jasmine.console_reporter.js
  148. 200  node_modules/jasmine-node/node_modules/jasmine-reporters/src/jasmine.junit_reporter.js
  149. 139  node_modules/jasmine-node/node_modules/jasmine-reporters/src/jasmine.teamcity_reporter.js
  150. 3  node_modules/jasmine-node/node_modules/jasmine-reporters/src/load_reporters.js
  151. 214  node_modules/jasmine-node/node_modules/jasmine-reporters/test/JUnitXmlReporterSpec.js
  152. 36  node_modules/jasmine-node/node_modules/jasmine-reporters/test/console_reporter.html
  153. 14  node_modules/jasmine-node/node_modules/jasmine-reporters/test/envjs.bootstrap.js
  154. 7  node_modules/jasmine-node/node_modules/jasmine-reporters/test/envjs.runner.sh
  155. 23  node_modules/jasmine-node/node_modules/jasmine-reporters/test/junit_xml_reporter.html
  156. 183  node_modules/jasmine-node/node_modules/jasmine-reporters/test/phantomjs-testrunner.js
  157. 36  node_modules/jasmine-node/node_modules/jasmine-reporters/test/phantomjs.runner.sh
  158. 36  node_modules/jasmine-node/node_modules/jasmine-reporters/test/teamcity_reporter.html
  159. 1  node_modules/jasmine-node/node_modules/requirejs/.npmignore
  160. 9,823  node_modules/jasmine-node/node_modules/requirejs/bin/r.js
  161. 24  node_modules/jasmine-node/node_modules/requirejs/package.json
  162. 2,053  node_modules/jasmine-node/node_modules/requirejs/require.js
  163. 1  node_modules/jasmine-node/node_modules/underscore/.gitignore
  164. 3  node_modules/jasmine-node/node_modules/underscore/.npmignore
  165. 22  node_modules/jasmine-node/node_modules/underscore/LICENSE
  166. 19  node_modules/jasmine-node/node_modules/underscore/README.md
  167. 1,975  node_modules/jasmine-node/node_modules/underscore/index.html
  168. 1  node_modules/jasmine-node/node_modules/underscore/index.js
  169. 10  node_modules/jasmine-node/node_modules/underscore/package.json
  170. 31  node_modules/jasmine-node/node_modules/underscore/underscore-min.js
  171. 999  node_modules/jasmine-node/node_modules/underscore/underscore.js
  172. 28  node_modules/jasmine-node/package.json
  173. 8  node_modules/jasmine-node/scripts/specs
  174. 7  node_modules/jasmine-node/spec/AsyncSpec.coffee
  175. 4  node_modules/jasmine-node/spec/CoffeeSpec.coffee
  176. 22  node_modules/jasmine-node/spec/GrammarHelper.coffee
  177. 6  node_modules/jasmine-node/spec/HelperSpec.coffee
  178. 25  node_modules/jasmine-node/spec/SampleSpecs.js
  179. 5  node_modules/jasmine-node/spec/TestSpec.js
  180. 131  node_modules/jasmine-node/spec/async-callback_spec.js
  181. 7  node_modules/jasmine-node/spec/helper_spec.js
  182. 5  node_modules/jasmine-node/spec/nested.js/NestedSpec.js
  183. 5  node_modules/jasmine-node/spec/nested/NestedSpec.js
  184. 11  node_modules/jasmine-node/spec/nested/uber-nested/UberNestedSpec.js
  185. 432  node_modules/jasmine-node/spec/reporter_spec.js
  186. 19  node_modules/jasmine-node/spec/sample_helper.js
  187. 3  node_modules/jasmine-node/specs.sh
  188. 0  z b/node_modules/jasmine-node/node_modules/findit/test/foo/a/b/z
53  README.md
Source Rendered
@@ -118,3 +118,56 @@ Extensive docs and a full demo are available at <http://akdubya.github.com/dustj
118 118
     {:else}
119 119
      {@pre.i18n key="no" text="No, there are less than 3 names"/}
120 120
     {/if}
  121
+
  122
+Global Aliases in dust
  123
+----------------------
  124
+
  125
+Most often we tend to reuse the same data in the template again and again ... One way to avoid been repetitive is use aliases. So a common question was, how does dust support this ?
  126
+
  127
+Well, in dust there is more than one way neat way to do this.
  128
+
  129
+*Use Inline Partials*
  130
+
  131
+	Inline partials never output content themselves, and are always global to the template in which they are defined, so the order of their definition has no significance.
  132
+
  133
+	Key points to note : They are global to the template., there is no ordering and can be defined anywhere
  134
+
  135
+	*Step 1* create global alias
  136
+
  137
+	     {<greeting}Hello, Hola{/greeting}   
  138
+
  139
+	*Step 2*
  140
+
  141
+	     {#names}
  142
+	       {.} {+greeting/} 
  143
+	     {/names}
  144
+
  145
+	     {#projects}
  146
+	       {.} {+greeting/}
  147
+	     {/projects}
  148
+
  149
+
  150
+
  151
+Block Aliases in dust
  152
+----------------------
  153
+Inline parameters appear within the section's opening tag. Parameters are separated by a single space.
  154
+
  155
+	     {#profile bar="baz" bing="bong"}
  156
+	      {name}, {bar}, {bing}
  157
+	     {/profile}
  158
+
  159
+	*There are 3 flavors*
  160
+
  161
+	    {#test greeting="hello"} // constant b
  162
+	     {greeting}
  163
+	    {/test}
  164
+
  165
+	    {#test greeting=hello} // looks for a json context hello in the JSON hierarchy
  166
+	     {greeting}
  167
+	    {/test}
  168
+
  169
+
  170
+	    {#test greeting="{hello}"} // resolves hello when greeting is referenced in the block and it    resolves to the first one in the hierarchy
  171
+	     {greeting}
  172
+	    {/test}
  173
+
0  c/w b/node_modules/jasmine-node/node_modules/findit/test/foo/a/b/c/w
No changes.
1  node_modules/.bin/jasmine-node
1  node_modules/jasmine-node/.idea/.name
... ...
@@ -0,0 +1 @@
  1
+jasmine-node
12  node_modules/jasmine-node/.npmignore
... ...
@@ -0,0 +1,12 @@
  1
+.DS_Store
  2
+.idea
  3
+*.iml
  4
+*.ipr
  5
+*.iws
  6
+*.tmproj
  7
+.project
  8
+.settings
  9
+.externalToolBuilders
  10
+*.swp
  11
+node_modules
  12
+*~
22  node_modules/jasmine-node/LICENSE
... ...
@@ -0,0 +1,22 @@
  1
+The MIT License
  2
+
  3
+Copyright (c) 2010 Adam Abrons and Misko Hevery http://getangular.com
  4
+
  5
+Permission is hereby granted, free of charge, to any person obtaining a copy
  6
+of this software and associated documentation files (the "Software"), to deal
  7
+in the Software without restriction, including without limitation the rights
  8
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9
+copies of the Software, and to permit persons to whom the Software is
  10
+furnished to do so, subject to the following conditions:
  11
+
  12
+The above copyright notice and this permission notice shall be included in
  13
+all copies or substantial portions of the Software.
  14
+
  15
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21
+THE SOFTWARE.
  22
+
56  node_modules/jasmine-node/README.md
Source Rendered
... ...
@@ -0,0 +1,56 @@
  1
+jasmine-node
  2
+======
  3
+
  4
+This node.js module makes the wonderful Pivotal Lab's jasmine
  5
+(http://github.com/pivotal/jasmine) spec framework available in
  6
+node.js.
  7
+
  8
+install
  9
+------
  10
+    npm install jasmine-node -g
  11
+
  12
+usage
  13
+------
  14
+
  15
+Write the specifications for your code in *.js and *.coffee files in the 
  16
+spec/ directory (note: your specification files must end with either 
  17
+.spec.js or .spec.coffee; otherwise jasmine-node won't find them!). You 
  18
+can use sub-directories to better organise your specs.
  19
+
  20
+If you have installed the npm package, you can run it with:
  21
+
  22
+    jasmine-node
  23
+
  24
+If you aren't using npm, you should add `pwd`/lib to the $NODE_PATH
  25
+environment variable, then run:
  26
+
  27
+    node lib/jasmine-node/cli.js
  28
+
  29
+
  30
+You can supply the following arguments:
  31
+
  32
+  * <code>--autotest</code>, provides automatic execution of specs after
  33
+    each changes
  34
+  * <code>--coffee</code>, allow execution of .coffee specs
  35
+  * <code>--color</code>, indicates spec output should uses color to
  36
+indicates passing (green) or failing (red) specs
  37
+  * <code>--noColor</code>, do not use color in the output
  38
+  * <code>--verbose</code>, verbose output as the specs are run
  39
+  * <code>--junitreport</code>, export tests results as junitreport xml format'
  40
+
  41
+Checkout spec/SampleSpecs.js to see how to use it.
  42
+
  43
+
  44
+development
  45
+-----------
  46
+Install the dependent packages by running:
  47
+
  48
+    npm install
  49
+
  50
+Run the specs before you send your pull request:
  51
+
  52
+    scripts/specs
  53
+
  54
+or
  55
+
  56
+    scripts/specs --verbose
7  node_modules/jasmine-node/bin/jasmine-node
... ...
@@ -0,0 +1,7 @@
  1
+#!/usr/bin/env node
  2
+
  3
+if( !process.env.NODE_ENV ) process.env.NODE_ENV = 'test';
  4
+
  5
+var path = require('path');
  6
+var fs   = require('fs');
  7
+require(path.join(__dirname,'../lib/jasmine-node/cli.js'));
41  node_modules/jasmine-node/lib/jasmine-node/async-callback.js
... ...
@@ -0,0 +1,41 @@
  1
+(function() {
  2
+  var withoutAsync = {};
  3
+
  4
+  ["it", "beforeEach", "afterEach"].forEach(function(jasmineFunction) {
  5
+    withoutAsync[jasmineFunction] = jasmine.Env.prototype[jasmineFunction];
  6
+    return jasmine.Env.prototype[jasmineFunction] = function() {
  7
+      var args = Array.prototype.slice.call(arguments, 0);
  8
+      var specFunction = args.pop();
  9
+      if (specFunction.length === 0) {
  10
+        args.push(specFunction);
  11
+      } else {
  12
+        args.push(function() {
  13
+          return asyncSpec(specFunction, this);
  14
+        });
  15
+      }
  16
+      return withoutAsync[jasmineFunction].apply(this, args);
  17
+    };
  18
+  });
  19
+
  20
+  function asyncSpec(specFunction, spec, timeout) {
  21
+    if (timeout == null) timeout = 1000;
  22
+    var done = false;
  23
+    spec.runs(function() {
  24
+      try {
  25
+        return specFunction(function(error) {
  26
+          done = true;
  27
+          if (error != null) return spec.fail(error);
  28
+        });
  29
+      } catch (e) {
  30
+        done = true;
  31
+        throw e;
  32
+      }
  33
+    });
  34
+    return spec.waitsFor(function() {
  35
+      if (done === true) {
  36
+        return true;
  37
+      }
  38
+    }, "spec to complete", timeout);
  39
+  };
  40
+
  41
+}).call(this);
86  node_modules/jasmine-node/lib/jasmine-node/autotest.js
... ...
@@ -0,0 +1,86 @@
  1
+var findit = require('findit');
  2
+var collection = require('./spec-collection');
  3
+var path = require('path');
  4
+var fs = require('fs');
  5
+var child_process = require('child_process');
  6
+
  7
+var baseArgv = [];
  8
+
  9
+for(var i = 0; i < process.argv.length; i++) {
  10
+    if(process.argv[i] !== '--autotest') {
  11
+        baseArgv.push(process.argv[i]);
  12
+    }
  13
+}
  14
+
  15
+var run_external = function(command, args, callback) {
  16
+    var child = child_process.spawn(command, args);
  17
+    child.stdout.on('data', function(data) {
  18
+        process.stdout.write(data);
  19
+    });
  20
+    if(typeof callback == 'function') {
  21
+        child.on('exit', callback);
  22
+    }
  23
+}
  24
+
  25
+var run_everything = function() {
  26
+    // run the suite when it starts
  27
+    var argv = [].concat(baseArgv);
  28
+    run_external(argv.shift(), argv, function() { console.log(arguments) });
  29
+}
  30
+
  31
+var last_run_succesful = true;
  32
+
  33
+var watchFile = function(file, stat) {
  34
+
  35
+    var file = path.normalize(file)
  36
+
  37
+    var prevStats = stat;
  38
+    
  39
+    var watcher = fs.watch(file, function(ev) {
  40
+
  41
+        if(!path.existsSync(file)) {
  42
+           watcher.close();
  43
+           return;
  44
+        }      
  45
+
  46
+        var currStats = fs.statSync( file );
  47
+    
  48
+        if(prevStats.mtime.getTime() != currStats.mtime.getTime()) {
  49
+
  50
+            // narrow down a pattern to reduce the specs runned
  51
+            var match = path.basename(file, path.extname(file)) + ".*";
  52
+            match = match.replace(new RegExp("spec", "i"), "");
  53
+
  54
+            // so we need to rerun the jasmine suite
  55
+            var argv = [].concat(baseArgv, ["--match", match]);
  56
+            run_external(argv.shift(), argv, function(code) {
  57
+                // run everything if we fixed some bugs
  58
+                if(code == 0) {
  59
+                    if(!last_run_succesful) {
  60
+                        run_everything();
  61
+                    }
  62
+                    last_run_succesful = true;
  63
+                } else {
  64
+                    last_run_succesful = false;
  65
+                }
  66
+            });
  67
+        }
  68
+    });
  69
+}
  70
+
  71
+
  72
+exports.start = function(loadpath, pattern) {
  73
+
  74
+    var finder = findit.find(loadpath);
  75
+
  76
+    finder.on('file', function(file, stat) { 
  77
+        var basename = path.basename(file);
  78
+
  79
+        if(pattern.test(basename)) {
  80
+            watchFile(file,stat);
  81
+        }
  82
+
  83
+    });
  84
+
  85
+    run_everything();
  86
+}
182  node_modules/jasmine-node/lib/jasmine-node/cli.js
... ...
@@ -0,0 +1,182 @@
  1
+var jasmine = require('./index');
  2
+var util,
  3
+    Path= require('path');
  4
+try {
  5
+  util = require('util')
  6
+} catch(e) {
  7
+  util = require('sys')
  8
+}
  9
+
  10
+var helperCollection = require('./spec-collection');
  11
+
  12
+var specFolder = null;
  13
+
  14
+for (var key in jasmine)
  15
+  global[key] = jasmine[key];
  16
+
  17
+var isVerbose = false;
  18
+var showColors = true;
  19
+var teamcity = process.env.TEAMCITY_PROJECT_NAME || false;
  20
+var useRequireJs = false;
  21
+var extentions = "js";
  22
+var match = '.';
  23
+var matchall = false;
  24
+var autotest = false;
  25
+var useHelpers = true;
  26
+var forceExit = false;
  27
+
  28
+var junitreport = {
  29
+  report: false,
  30
+  savePath : "./reports/",
  31
+  useDotNotation: true,
  32
+  consolidate: true
  33
+}
  34
+
  35
+var args = process.argv.slice(2);
  36
+
  37
+while(args.length) {
  38
+  var arg = args.shift();
  39
+
  40
+  switch(arg)
  41
+  {
  42
+    case '--color':
  43
+      showColors = true;
  44
+      break;
  45
+    case '--noColor':
  46
+    case '--nocolor':
  47
+      showColors = false;
  48
+      break;
  49
+    case '--verbose':
  50
+      isVerbose = true;
  51
+      break;
  52
+    case '--coffee':
  53
+      require('coffee-script');
  54
+      extentions = "js|coffee";
  55
+      break;
  56
+    case '-m':
  57
+    case '--match':
  58
+      match = args.shift();
  59
+      break;
  60
+    case '--matchall':
  61
+      matchall = true;
  62
+      break;
  63
+    case '--junitreport':
  64
+        junitreport.report = true;
  65
+        break;
  66
+    case '--output':
  67
+        junitreport.savePath = args.shift();
  68
+        break;
  69
+    case '--teamcity':
  70
+        teamcity = true;
  71
+        break;
  72
+    case '--runWithRequireJs':
  73
+        useRequireJs = true;
  74
+        break;
  75
+    case '--nohelpers':
  76
+        useHelpers = false;
  77
+        break;
  78
+    case '--test-dir':
  79
+        var dir = args.shift();
  80
+
  81
+        if(!Path.existsSync(dir))
  82
+          throw new Error("Test root path '" + dir + "' doesn't exist!");
  83
+
  84
+        specFolder = dir; // NOTE: Does not look from current working directory.
  85
+        break;
  86
+    case '--autotest':
  87
+        autotest = true;
  88
+        break;
  89
+    case '--forceexit':
  90
+        forceExit = true;
  91
+        break;
  92
+    case '-h':
  93
+        help();
  94
+    default:
  95
+      if (arg.match(/^--/)) help();
  96
+      if (arg.match(/^\/.*/)) {
  97
+        specFolder = arg;
  98
+      } else {
  99
+        specFolder = Path.join(process.cwd(), arg);
  100
+      }
  101
+      break;
  102
+  }
  103
+}
  104
+
  105
+if (!specFolder) {
  106
+  help();
  107
+}
  108
+
  109
+if (autotest) {
  110
+  require('./autotest').start(specFolder,
  111
+                            new RegExp(".+\\.(" + extentions + ")$", "i"));
  112
+  return;
  113
+}
  114
+
  115
+var exitCode = 0;
  116
+
  117
+process.on("exit", onExit);
  118
+
  119
+function onExit() {
  120
+  process.removeListener("exit", onExit);
  121
+  process.exit(exitCode);
  122
+}
  123
+
  124
+var onComplete = function(runner, log) {
  125
+  util.print('\n');
  126
+  if (runner.results().failedCount == 0) {
  127
+    exitCode = 0;
  128
+  } else {
  129
+    exitCode = 1;
  130
+  }
  131
+  if (forceExit) {
  132
+    process.exit(exitCode);
  133
+  }
  134
+};
  135
+
  136
+if(useHelpers){
  137
+  jasmine.loadHelpersInFolder(specFolder,
  138
+                              new RegExp("helpers?\\.(" + extentions + ")$", 'i'));
  139
+}
  140
+
  141
+var regExpSpec = new RegExp(match + (matchall ? "" : "spec\\.") + "(" + extentions + ")$", 'i')
  142
+
  143
+helperCollection.load(specFolder, regExpSpec);
  144
+
  145
+if(helperCollection.getSpecs().length === 0) {
  146
+    match = "";
  147
+}
  148
+
  149
+jasmine.executeSpecsInFolder(specFolder,
  150
+                             onComplete,
  151
+                             isVerbose,
  152
+                             showColors,
  153
+                             teamcity,
  154
+                             useRequireJs,
  155
+                             regExpSpec,
  156
+                             junitreport);
  157
+
  158
+function help(){
  159
+  util.print([
  160
+    'USAGE: jasmine-node [--color|--noColor] [--verbose] [--coffee] directory'
  161
+  , ''
  162
+  , 'Options:'
  163
+  , '  --autotest         - rerun automatically the specs when a file changes'
  164
+  , '  --color            - use color coding for output'
  165
+  , '  --noColor          - do not use color coding for output'
  166
+  , '  -m, --match REGEXP - load only specs containing "REGEXPspec"'
  167
+  , '  --matchall         - relax requirement of "spec" in spec file names'
  168
+  , '  --verbose          - print extra information per each test run'
  169
+  , '  --coffee           - load coffee-script which allows execution .coffee files'
  170
+  , '  --junitreport      - export tests results as junitreport xml format'
  171
+  , '  --output           - defines the output folder for junitreport files'
  172
+  , '  --teamcity         - converts all console output to teamcity custom test runner commands. (Normally auto detected.)'
  173
+  , '  --runWithRequireJs - loads all specs using requirejs instead of node\'s native require method'
  174
+  , '  --test-dir         - the absolute root directory path where tests are located'
  175
+  , '  --nohelpers        - does not load helpers.'
  176
+  , '  --forceexit        - force exit once tests complete.'
  177
+  , '  -h, --help         - display this help and exit'
  178
+  , ''
  179
+  ].join("\n"));
  180
+
  181
+  process.exit(-1);
  182
+}
148  node_modules/jasmine-node/lib/jasmine-node/index.js
... ...
@@ -0,0 +1,148 @@
  1
+var fs = require('fs');
  2
+var util;
  3
+try {
  4
+  util = require('util')
  5
+} catch(e) {
  6
+  util = require('sys')
  7
+}
  8
+
  9
+var path = require('path');
  10
+
  11
+var filename = __dirname + '/jasmine-2.0.0.rc1.js';
  12
+global.window = {
  13
+  setTimeout: setTimeout,
  14
+  clearTimeout: clearTimeout,
  15
+  setInterval: setInterval,
  16
+  clearInterval: clearInterval
  17
+};
  18
+
  19
+var src = fs.readFileSync(filename);
  20
+var jasmine;
  21
+var minorVersion = process.version.match(/\d\.(\d)\.\d/)[1];
  22
+switch (minorVersion) {
  23
+  case "1":
  24
+  case "2":
  25
+    jasmine = process.compile(src + '\njasmine;', filename);
  26
+    break;
  27
+  default:
  28
+    jasmine = require('vm').runInThisContext(src + "\njasmine;", filename);
  29
+}
  30
+
  31
+delete global.window;
  32
+require("./async-callback");
  33
+require("jasmine-reporters");
  34
+
  35
+var jasmineNode = require('./reporter').jasmineNode;
  36
+
  37
+jasmine.loadHelpersInFolder=function(folder, matcher)
  38
+{
  39
+  var helpers = [],
  40
+      helperCollection = require('./spec-collection');
  41
+
  42
+  helperCollection.load(folder, matcher);
  43
+  helpers = helperCollection.getSpecs();
  44
+
  45
+  for (var i = 0, len = helpers.length; i < len; ++i)
  46
+  {
  47
+    var file = helpers[i].path();
  48
+    var helper= require(file.replace(/\.*$/, ""));
  49
+    for (var key in helper)
  50
+      global[key]= helper[key];
  51
+  }
  52
+};
  53
+
  54
+function removeJasmineFrames(text) {
  55
+  var lines = [];
  56
+  text.split(/\n/).forEach(function(line){
  57
+    if (line.indexOf(filename) == -1) {
  58
+      lines.push(line);
  59
+    }
  60
+  });
  61
+  return lines.join('\n');
  62
+}
  63
+
  64
+jasmine.executeSpecsInFolder = function(folder,
  65
+                                        done,
  66
+                                        isVerbose,
  67
+                                        showColors,
  68
+                                        teamcity,
  69
+                                        useRequireJs,
  70
+                                        matcher,
  71
+                                        junitreport){
  72
+  var fileMatcher = matcher || new RegExp(".(js)$", "i"),
  73
+      colors = showColors || false,
  74
+      specs = require('./spec-collection'),
  75
+      jasmineEnv = jasmine.getEnv();
  76
+
  77
+  specs.load(folder, fileMatcher);
  78
+
  79
+  if(junitreport && junitreport.report) {
  80
+    if(!path.existsSync(junitreport.savePath)) {
  81
+      util.puts('creating junit xml report save path: ' + junitreport.savePath);
  82
+      fs.mkdirSync(junitreport.savePath, "0755");
  83
+    }
  84
+    jasmineEnv.addReporter(new jasmine.JUnitXmlReporter(junitreport.savePath,
  85
+                                                        junitreport.consolidate,
  86
+                                                        junitreport.useDotNotation));
  87
+  }
  88
+
  89
+  if(teamcity){
  90
+    jasmineEnv.addReporter(new jasmineNode.TerminalReporter({print:       util.print,
  91
+                                                 color:       false,
  92
+                                                 onComplete:  done,
  93
+                                                 stackFilter: removeJasmineFrames}));
  94
+  } else if(isVerbose) {
  95
+    jasmineEnv.addReporter(new jasmineNode.TerminalVerboseReporter({ print:       util.print,
  96
+                                                         color:       showColors,
  97
+                                                         onComplete:  done,
  98
+                                                         stackFilter: removeJasmineFrames}));
  99
+  } else {
  100
+    jasmineEnv.addReporter(new jasmineNode.TerminalReporter({print:       util.print,
  101
+                                                 color:       showColors,
  102
+                                                 onComplete:  done,
  103
+                                                 stackFilter: removeJasmineFrames}));
  104
+  }
  105
+
  106
+  if (useRequireJs) {
  107
+    require('./requirejs-runner').executeJsRunner(specs, done, jasmineEnv);
  108
+  } else {
  109
+    var specsList = specs.getSpecs();
  110
+
  111
+    for (var i = 0, len = specsList.length; i < len; ++i) {
  112
+      var filename = specsList[i];
  113
+      require(filename.path().replace(/\.\w+$/, ""));
  114
+    }
  115
+
  116
+    jasmineEnv.execute();
  117
+  }
  118
+};
  119
+
  120
+function now(){
  121
+  return new Date().getTime();
  122
+}
  123
+
  124
+jasmine.asyncSpecWait = function(){
  125
+  var wait = jasmine.asyncSpecWait;
  126
+  wait.start = now();
  127
+  wait.done = false;
  128
+  (function innerWait(){
  129
+    waits(10);
  130
+    runs(function() {
  131
+      if (wait.start + wait.timeout < now()) {
  132
+        expect('timeout waiting for spec').toBeNull();
  133
+      } else if (wait.done) {
  134
+        wait.done = false;
  135
+      } else {
  136
+        innerWait();
  137
+      }
  138
+    });
  139
+  })();
  140
+};
  141
+jasmine.asyncSpecWait.timeout = 4 * 1000;
  142
+jasmine.asyncSpecDone = function(){
  143
+  jasmine.asyncSpecWait.done = true;
  144
+};
  145
+
  146
+for ( var key in jasmine) {
  147
+  exports[key] = jasmine[key];
  148
+}
2,479  node_modules/jasmine-node/lib/jasmine-node/jasmine-2.0.0.rc1.js
... ...
@@ -0,0 +1,2479 @@
  1
+var isCommonJS = typeof window == "undefined";
  2
+
  3
+/**
  4
+ * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
  5
+ *
  6
+ * @namespace
  7
+ */
  8
+var jasmine = {};
  9
+if (isCommonJS) exports.jasmine = jasmine;
  10
+/**
  11
+ * @private
  12
+ */
  13
+jasmine.unimplementedMethod_ = function() {
  14
+  throw new Error("unimplemented method");
  15
+};
  16
+
  17
+/**
  18
+ * Use <code>jasmine.undefined</code> instead of <code>undefined</code>, since <code>undefined</code> is just
  19
+ * a plain old variable and may be redefined by somebody else.
  20
+ *
  21
+ * @private
  22
+ */
  23
+jasmine.undefined = jasmine.___undefined___;
  24
+
  25
+/**
  26
+ * Show diagnostic messages in the console if set to true
  27
+ *
  28
+ */
  29
+jasmine.VERBOSE = false;
  30
+
  31
+/**
  32
+ * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed.
  33
+ *
  34
+ */
  35
+jasmine.DEFAULT_UPDATE_INTERVAL = 250;
  36
+
  37
+/**
  38
+ * Default timeout interval in milliseconds for waitsFor() blocks.
  39
+ */
  40
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
  41
+
  42
+jasmine.getGlobal = function() {
  43
+  function getGlobal() {
  44
+    return this;
  45
+  }
  46
+
  47
+  return getGlobal();
  48
+};
  49
+
  50
+/**
  51
+ * Allows for bound functions to be compared.  Internal use only.
  52
+ *
  53
+ * @ignore
  54
+ * @private
  55
+ * @param base {Object} bound 'this' for the function
  56
+ * @param name {Function} function to find
  57
+ */
  58
+jasmine.bindOriginal_ = function(base, name) {
  59
+  var original = base[name];
  60
+  if (original.apply) {
  61
+    return function() {
  62
+      return original.apply(base, arguments);
  63
+    };
  64
+  } else {
  65
+    // IE support
  66
+    return jasmine.getGlobal()[name];
  67
+  }
  68
+};
  69
+
  70
+jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout');
  71
+jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout');
  72
+jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval');
  73
+jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval');
  74
+
  75
+jasmine.MessageResult = function(values) {
  76
+  this.type = 'log';
  77
+  this.values = values;
  78
+  this.trace = new Error(); // todo: test better
  79
+};
  80
+
  81
+jasmine.MessageResult.prototype.toString = function() {
  82
+  var text = "";
  83
+  for (var i = 0; i < this.values.length; i++) {
  84
+    if (i > 0) text += " ";
  85
+    if (jasmine.isString_(this.values[i])) {
  86
+      text += this.values[i];
  87
+    } else {
  88
+      text += jasmine.pp(this.values[i]);
  89
+    }
  90
+  }
  91
+  return text;
  92
+};
  93
+
  94
+jasmine.ExpectationResult = function(params) {
  95
+  this.type = 'expect';
  96
+  this.matcherName = params.matcherName;
  97
+  this.passed_ = params.passed;
  98
+  this.expected = params.expected;
  99
+  this.actual = params.actual;
  100
+  this.message = this.passed_ ? 'Passed.' : params.message;
  101
+
  102
+  var trace = (params.trace || new Error(this.message));
  103
+  this.trace = this.passed_ ? '' : trace;
  104
+};
  105
+
  106
+jasmine.ExpectationResult.prototype.toString = function () {
  107
+  return this.message;
  108
+};
  109
+
  110
+jasmine.ExpectationResult.prototype.passed = function () {
  111
+  return this.passed_;
  112
+};
  113
+
  114
+/**
  115
+ * Getter for the Jasmine environment. Ensures one gets created
  116
+ */
  117
+jasmine.getEnv = function() {
  118
+  var env = jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env();
  119
+  return env;
  120
+};
  121
+
  122
+/**
  123
+ * @ignore
  124
+ * @private
  125
+ * @param value
  126
+ * @returns {Boolean}
  127
+ */
  128
+jasmine.isArray_ = function(value) {
  129
+  return jasmine.isA_("Array", value);
  130
+};
  131
+
  132
+/**
  133
+ * @ignore
  134
+ * @private
  135
+ * @param value
  136
+ * @returns {Boolean}
  137
+ */
  138
+jasmine.isString_ = function(value) {
  139
+  return jasmine.isA_("String", value);
  140
+};
  141
+
  142
+/**
  143
+ * @ignore
  144
+ * @private
  145
+ * @param value
  146
+ * @returns {Boolean}
  147
+ */
  148
+jasmine.isNumber_ = function(value) {
  149
+  return jasmine.isA_("Number", value);
  150
+};
  151
+
  152
+/**
  153
+ * @ignore
  154
+ * @private
  155
+ * @param {String} typeName
  156
+ * @param value
  157
+ * @returns {Boolean}
  158
+ */
  159
+jasmine.isA_ = function(typeName, value) {
  160
+  return Object.prototype.toString.apply(value) === '[object ' + typeName + ']';
  161
+};
  162
+
  163
+/**
  164
+ * Pretty printer for expecations.  Takes any object and turns it into a human-readable string.
  165
+ *
  166
+ * @param value {Object} an object to be outputted
  167
+ * @returns {String}
  168
+ */
  169
+jasmine.pp = function(value) {
  170
+  var stringPrettyPrinter = new jasmine.StringPrettyPrinter();
  171
+  stringPrettyPrinter.format(value);
  172
+  return stringPrettyPrinter.string;
  173
+};
  174
+
  175
+/**
  176
+ * Returns true if the object is a DOM Node.
  177
+ *
  178
+ * @param {Object} obj object to check
  179
+ * @returns {Boolean}
  180
+ */
  181
+jasmine.isDomNode = function(obj) {
  182
+  return obj.nodeType > 0;
  183
+};
  184
+
  185
+/**
  186
+ * Returns a matchable 'generic' object of the class type.  For use in expecations of type when values don't matter.
  187
+ *
  188
+ * @example
  189
+ * // don't care about which function is passed in, as long as it's a function
  190
+ * expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function));
  191
+ *
  192
+ * @param {Class} clazz
  193
+ * @returns matchable object of the type clazz
  194
+ */
  195
+jasmine.any = function(clazz) {
  196
+  return new jasmine.Matchers.Any(clazz);
  197
+};
  198
+
  199
+/**
  200
+ * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks.
  201
+ *
  202
+ * Spies should be created in test setup, before expectations.  They can then be checked, using the standard Jasmine
  203
+ * expectation syntax. Spies can be checked if they were called or not and what the calling params were.
  204
+ *
  205
+ * A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs).
  206
+ *
  207
+ * Spies are torn down at the end of every spec.
  208
+ *
  209
+ * Note: Do <b>not</b> call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj.
  210
+ *
  211
+ * @example
  212
+ * // a stub
  213
+ * var myStub = jasmine.createSpy('myStub');  // can be used anywhere
  214
+ *
  215
+ * // spy example
  216
+ * var foo = {
  217
+ *   not: function(bool) { return !bool; }
  218
+ * }
  219
+ *
  220
+ * // actual foo.not will not be called, execution stops
  221
+ * spyOn(foo, 'not');
  222
+
  223
+ // foo.not spied upon, execution will continue to implementation
  224
+ * spyOn(foo, 'not').andCallThrough();
  225
+ *
  226
+ * // fake example
  227
+ * var foo = {
  228
+ *   not: function(bool) { return !bool; }
  229
+ * }
  230
+ *
  231
+ * // foo.not(val) will return val
  232
+ * spyOn(foo, 'not').andCallFake(function(value) {return value;});
  233
+ *
  234
+ * // mock example
  235
+ * foo.not(7 == 7);
  236
+ * expect(foo.not).toHaveBeenCalled();
  237
+ * expect(foo.not).toHaveBeenCalledWith(true);
  238
+ *
  239
+ * @constructor
  240
+ * @see spyOn, jasmine.createSpy, jasmine.createSpyObj
  241
+ * @param {String} name
  242
+ */
  243
+jasmine.Spy = function(name) {
  244
+  /**
  245
+   * The name of the spy, if provided.
  246
+   */
  247
+  this.identity = name || 'unknown';
  248
+  /**
  249
+   *  Is this Object a spy?
  250
+   */
  251
+  this.isSpy = true;
  252
+  /**
  253
+   * The actual function this spy stubs.
  254
+   */
  255
+  this.plan = function() {
  256
+  };
  257
+  /**
  258
+   * Tracking of the most recent call to the spy.
  259
+   * @example
  260
+   * var mySpy = jasmine.createSpy('foo');
  261
+   * mySpy(1, 2);
  262
+   * mySpy.mostRecentCall.args = [1, 2];
  263
+   */
  264
+  this.mostRecentCall = {};
  265
+
  266
+  /**
  267
+   * Holds arguments for each call to the spy, indexed by call count
  268
+   * @example
  269
+   * var mySpy = jasmine.createSpy('foo');
  270
+   * mySpy(1, 2);
  271
+   * mySpy(7, 8);
  272
+   * mySpy.mostRecentCall.args = [7, 8];
  273
+   * mySpy.argsForCall[0] = [1, 2];
  274
+   * mySpy.argsForCall[1] = [7, 8];
  275
+   */
  276
+  this.argsForCall = [];
  277
+  this.calls = [];
  278
+};
  279
+
  280
+/**
  281
+ * Tells a spy to call through to the actual implemenatation.
  282
+ *
  283
+ * @example
  284
+ * var foo = {
  285
+ *   bar: function() { // do some stuff }
  286
+ * }
  287
+ *
  288
+ * // defining a spy on an existing property: foo.bar
  289
+ * spyOn(foo, 'bar').andCallThrough();
  290
+ */
  291
+jasmine.Spy.prototype.andCallThrough = function() {
  292
+  this.plan = this.originalValue;
  293
+  return this;
  294
+};
  295
+
  296
+/**
  297
+ * For setting the return value of a spy.
  298
+ *
  299
+ * @example
  300
+ * // defining a spy from scratch: foo() returns 'baz'
  301
+ * var foo = jasmine.createSpy('spy on foo').andReturn('baz');
  302
+ *
  303
+ * // defining a spy on an existing property: foo.bar() returns 'baz'
  304
+ * spyOn(foo, 'bar').andReturn('baz');
  305
+ *
  306
+ * @param {Object} value
  307
+ */
  308
+jasmine.Spy.prototype.andReturn = function(value) {
  309
+  this.plan = function() {
  310
+    return value;
  311
+  };
  312
+  return this;
  313
+};
  314
+
  315
+/**
  316
+ * For throwing an exception when a spy is called.
  317
+ *
  318
+ * @example
  319
+ * // defining a spy from scratch: foo() throws an exception w/ message 'ouch'
  320
+ * var foo = jasmine.createSpy('spy on foo').andThrow('baz');
  321
+ *
  322
+ * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch'
  323
+ * spyOn(foo, 'bar').andThrow('baz');
  324
+ *
  325
+ * @param {String} exceptionMsg
  326
+ */
  327
+jasmine.Spy.prototype.andThrow = function(exceptionMsg) {
  328
+  this.plan = function() {
  329
+    throw exceptionMsg;
  330
+  };
  331
+  return this;
  332
+};
  333
+
  334
+/**
  335
+ * Calls an alternate implementation when a spy is called.
  336
+ *
  337
+ * @example
  338
+ * var baz = function() {
  339
+ *   // do some stuff, return something
  340
+ * }
  341
+ * // defining a spy from scratch: foo() calls the function baz
  342
+ * var foo = jasmine.createSpy('spy on foo').andCall(baz);
  343
+ *
  344
+ * // defining a spy on an existing property: foo.bar() calls an anonymnous function
  345
+ * spyOn(foo, 'bar').andCall(function() { return 'baz';} );
  346
+ *
  347
+ * @param {Function} fakeFunc
  348
+ */
  349
+jasmine.Spy.prototype.andCallFake = function(fakeFunc) {
  350
+  this.plan = fakeFunc;
  351
+  return this;
  352
+};