Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

generalized configuration for requirejs template, updated jasmine, ad…

…ded loader plugin closing #5, #6, #7
  • Loading branch information...
commit f1ff456c738de8d36146498f55bf0d40f5bc6939 1 parent 843a391
Jarrod Overson jsoverson authored
Showing with 501 additions and 24,490 deletions.
  1. +4 −0 CHANGELOG
  2. +26 −25 Gruntfile.js
  3. +95 −70 README.md
  4. +49 −27 docs/jasmine-examples.md
  5. +34 −22 docs/jasmine-options.md
  6. +1 −2  package.json
  7. +10 −8 tasks/jasmine/templates/RequireJSRunner.tmpl
  8. +3 −3 tasks/lib/jasmine.js
  9. +34 −0 test/expected/basicRequireJSTemplate.html
  10. +24 −0 test/expected/defaultTemplate.html
  11. +40 −0 test/expected/requireJSTemplate.html
  12. +91 −2 test/jasmine_test.js
  13. 0  vendor/{jasmine → jasmine-1.3.0}/MIT.LICENSE
  14. +1 −1  vendor/{jasmine/lib/jasmine-core → jasmine-1.3.0}/jasmine-html.js
  15. 0  vendor/{jasmine/src/html → jasmine-1.3.0}/jasmine.css
  16. +89 −27 vendor/{jasmine/lib/jasmine-core → jasmine-1.3.0}/jasmine.js
  17. +0 −2  vendor/jasmine/.rspec
  18. +0 −45 vendor/jasmine/Contribute.markdown
  19. +0 −3  vendor/jasmine/Gemfile
  20. +0 −24 vendor/jasmine/README.markdown
  21. +0 −44 vendor/jasmine/Rakefile
  22. +0 −42 vendor/jasmine/Release.markdown
  23. +0 −15 vendor/jasmine/SpecRunner.html
  24. +0 −29 vendor/jasmine/config.rb
  25. BIN  vendor/jasmine/images/jasmine_favicon.png
  26. +0 −32 vendor/jasmine/jasmine-core.gemspec
  27. +0 −1  vendor/jasmine/jasmine_dev.thor
  28. +0 −17 vendor/jasmine/jsdoc-template/allclasses.tmpl
  29. +0 −56 vendor/jasmine/jsdoc-template/allfiles.tmpl
  30. +0 −646 vendor/jasmine/jsdoc-template/class.tmpl
  31. +0 −39 vendor/jasmine/jsdoc-template/index.tmpl
  32. +0 −184 vendor/jasmine/jsdoc-template/publish.js
  33. +0 −162 vendor/jasmine/jsdoc-template/static/default.css
  34. +0 −2  vendor/jasmine/jsdoc-template/static/header.html
  35. +0 −19 vendor/jasmine/jsdoc-template/static/index.html
  36. +0 −35 vendor/jasmine/jsdoc-template/symbol.tmpl
  37. +0 −5,919 vendor/jasmine/jshint/jshint.js
  38. +0 −99 vendor/jasmine/jshint/run.js
  39. +0 −36 vendor/jasmine/lib/jasmine-core.rb
  40. +0 −54 vendor/jasmine/lib/jasmine-core/example/SpecRunner.html
  41. +0 −58 vendor/jasmine/lib/jasmine-core/example/spec/PlayerSpec.js
  42. +0 −9 vendor/jasmine/lib/jasmine-core/example/spec/SpecHelper.js
  43. +0 −22 vendor/jasmine/lib/jasmine-core/example/src/Player.js
  44. +0 −7 vendor/jasmine/lib/jasmine-core/example/src/Song.js
  45. +0 −82 vendor/jasmine/lib/jasmine-core/jasmine.css
  46. +0 −478 vendor/jasmine/lib/jasmine-core/json2.js
  47. +0 −451 vendor/jasmine/lib/jasmine-core/spec/console/ConsoleReporterSpec.js
  48. +0 −27 vendor/jasmine/lib/jasmine-core/spec/core/BaseSpec.js
  49. +0 −97 vendor/jasmine/lib/jasmine-core/spec/core/CustomMatchersSpec.js
  50. +0 −159 vendor/jasmine/lib/jasmine-core/spec/core/EnvSpec.js
  51. +0 −175 vendor/jasmine/lib/jasmine-core/spec/core/ExceptionsSpec.js
  52. +0 −103 vendor/jasmine/lib/jasmine-core/spec/core/JsApiReporterSpec.js
  53. +0 −1,116 vendor/jasmine/lib/jasmine-core/spec/core/MatchersSpec.js
  54. +0 −38 vendor/jasmine/lib/jasmine-core/spec/core/MockClockSpec.js
  55. +0 −45 vendor/jasmine/lib/jasmine-core/spec/core/MultiReporterSpec.js
  56. +0 −54 vendor/jasmine/lib/jasmine-core/spec/core/NestedResultsSpec.js
  57. +0 −94 vendor/jasmine/lib/jasmine-core/spec/core/PrettyPrintSpec.js
  58. +0 −23 vendor/jasmine/lib/jasmine-core/spec/core/QueueSpec.js
  59. +0 −56 vendor/jasmine/lib/jasmine-core/spec/core/ReporterSpec.js
  60. +0 −267 vendor/jasmine/lib/jasmine-core/spec/core/RunnerSpec.js
  61. +0 −1,258 vendor/jasmine/lib/jasmine-core/spec/core/SpecRunningSpec.js
  62. +0 −124 vendor/jasmine/lib/jasmine-core/spec/core/SpecSpec.js
  63. +0 −201 vendor/jasmine/lib/jasmine-core/spec/core/SpySpec.js
  64. +0 −120 vendor/jasmine/lib/jasmine-core/spec/core/SuiteSpec.js
  65. +0 −39 vendor/jasmine/lib/jasmine-core/spec/core/UtilSpec.js
  66. +0 −118 vendor/jasmine/lib/jasmine-core/spec/core/WaitsForBlockSpec.js
  67. +0 −209 vendor/jasmine/lib/jasmine-core/spec/html/HTMLReporterSpec.js
  68. +0 −38 vendor/jasmine/lib/jasmine-core/spec/html/MatchersHtmlSpec.js
  69. +0 −8 vendor/jasmine/lib/jasmine-core/spec/html/PrettyPrintHtmlSpec.js
  70. +0 −239 vendor/jasmine/lib/jasmine-core/spec/html/TrivialReporterSpec.js
  71. +0 −127 vendor/jasmine/lib/jasmine-core/spec/node_suite.js
  72. +0 −86 vendor/jasmine/lib/jasmine-core/spec/runner.html
  73. +0 −51 vendor/jasmine/lib/jasmine-core/spec/spec_helper.rb
  74. +0 −33 vendor/jasmine/lib/jasmine-core/spec/tasks/build_distribution_spec.rb
  75. +0 −60 vendor/jasmine/lib/jasmine-core/spec/tasks/build_github_pages_spec.rb
  76. +0 −109 vendor/jasmine/lib/jasmine-core/spec/tasks/build_standalone_distribution_spec.rb
  77. +0 −63 vendor/jasmine/lib/jasmine-core/spec/tasks/build_standalone_runner_spec.rb
  78. +0 −26 vendor/jasmine/lib/jasmine-core/spec/tasks/count_specs_spec.rb
  79. +0 −81 vendor/jasmine/lib/jasmine-core/spec/tasks/execute_specs_spec.rb
  80. +0 −39 vendor/jasmine/lib/jasmine-core/spec/tasks/jshint_spec.rb
  81. +0 −39 vendor/jasmine/lib/jasmine-core/spec/tasks/release_spec.rb
  82. +0 −55 vendor/jasmine/lib/jasmine-core/spec/tasks/version_spec.rb
  83. +0 −49 vendor/jasmine/lib/jasmine-core/spec/templates/runner.html.erb
  84. +0 −1  vendor/jasmine/lib/jasmine-core/spec/templates/script_tag.html.erb
  85. +0 −6 vendor/jasmine/lib/jasmine-core/version.rb
  86. +0 −451 vendor/jasmine/spec/console/ConsoleReporterSpec.js
  87. +0 −27 vendor/jasmine/spec/core/BaseSpec.js
  88. +0 −97 vendor/jasmine/spec/core/CustomMatchersSpec.js
  89. +0 −159 vendor/jasmine/spec/core/EnvSpec.js
  90. +0 −175 vendor/jasmine/spec/core/ExceptionsSpec.js
  91. +0 −103 vendor/jasmine/spec/core/JsApiReporterSpec.js
  92. +0 −1,116 vendor/jasmine/spec/core/MatchersSpec.js
  93. +0 −38 vendor/jasmine/spec/core/MockClockSpec.js
  94. +0 −45 vendor/jasmine/spec/core/MultiReporterSpec.js
  95. +0 −54 vendor/jasmine/spec/core/NestedResultsSpec.js
  96. +0 −94 vendor/jasmine/spec/core/PrettyPrintSpec.js
  97. +0 −23 vendor/jasmine/spec/core/QueueSpec.js
  98. +0 −56 vendor/jasmine/spec/core/ReporterSpec.js
  99. +0 −267 vendor/jasmine/spec/core/RunnerSpec.js
  100. +0 −1,258 vendor/jasmine/spec/core/SpecRunningSpec.js
  101. +0 −124 vendor/jasmine/spec/core/SpecSpec.js
  102. +0 −201 vendor/jasmine/spec/core/SpySpec.js
  103. +0 −120 vendor/jasmine/spec/core/SuiteSpec.js
  104. +0 −39 vendor/jasmine/spec/core/UtilSpec.js
  105. +0 −118 vendor/jasmine/spec/core/WaitsForBlockSpec.js
  106. +0 −209 vendor/jasmine/spec/html/HTMLReporterSpec.js
  107. +0 −38 vendor/jasmine/spec/html/MatchersHtmlSpec.js
  108. +0 −8 vendor/jasmine/spec/html/PrettyPrintHtmlSpec.js
  109. +0 −239 vendor/jasmine/spec/html/TrivialReporterSpec.js
  110. +0 −127 vendor/jasmine/spec/node_suite.js
  111. +0 −86 vendor/jasmine/spec/runner.html
  112. +0 −51 vendor/jasmine/spec/spec_helper.rb
  113. +0 −33 vendor/jasmine/spec/tasks/build_distribution_spec.rb
  114. +0 −60 vendor/jasmine/spec/tasks/build_github_pages_spec.rb
  115. +0 −109 vendor/jasmine/spec/tasks/build_standalone_distribution_spec.rb
  116. +0 −63 vendor/jasmine/spec/tasks/build_standalone_runner_spec.rb
  117. +0 −26 vendor/jasmine/spec/tasks/count_specs_spec.rb
  118. +0 −81 vendor/jasmine/spec/tasks/execute_specs_spec.rb
  119. +0 −39 vendor/jasmine/spec/tasks/jshint_spec.rb
  120. +0 −39 vendor/jasmine/spec/tasks/release_spec.rb
  121. +0 −55 vendor/jasmine/spec/tasks/version_spec.rb
  122. +0 −49 vendor/jasmine/spec/templates/runner.html.erb
  123. +0 −1  vendor/jasmine/spec/templates/script_tag.html.erb
  124. +0 −177 vendor/jasmine/src/console/ConsoleReporter.js
  125. +0 −27 vendor/jasmine/src/core/Block.js
  126. +0 −277 vendor/jasmine/src/core/Env.js
  127. +0 −102 vendor/jasmine/src/core/JsApiReporter.js
  128. +0 −397 vendor/jasmine/src/core/Matchers.js
  129. +0 −35 vendor/jasmine/src/core/MultiReporter.js
  130. +0 −80 vendor/jasmine/src/core/NestedResults.js
  131. +0 −123 vendor/jasmine/src/core/PrettyPrinter.js
  132. +0 −99 vendor/jasmine/src/core/Queue.js
  133. +0 −31 vendor/jasmine/src/core/Reporter.js
  134. +0 −77 vendor/jasmine/src/core/Runner.js
  135. +0 −243 vendor/jasmine/src/core/Spec.js
  136. +0 −82 vendor/jasmine/src/core/Suite.js
  137. +0 −15 vendor/jasmine/src/core/WaitsBlock.js
  138. +0 −54 vendor/jasmine/src/core/WaitsForBlock.js
  139. +0 −639 vendor/jasmine/src/core/base.js
  140. +0 −183 vendor/jasmine/src/core/mock-timeout.js
  141. +0 −67 vendor/jasmine/src/core/util.js
  142. +0 −165 vendor/jasmine/src/html/HtmlReporter.js
  143. +0 −60 vendor/jasmine/src/html/HtmlReporterHelpers.js
  144. +0 −164 vendor/jasmine/src/html/ReporterView.js
  145. +0 −79 vendor/jasmine/src/html/SpecView.js
  146. +0 −22 vendor/jasmine/src/html/SuiteView.js
  147. +0 −192 vendor/jasmine/src/html/TrivialReporter.js
  148. +0 −309 vendor/jasmine/src/html/_HTMLReporter.scss
  149. +0 −169 vendor/jasmine/src/html/_TrivialReporter.scss
  150. +0 −2  vendor/jasmine/src/html/jasmine.scss
  151. +0 −3  vendor/jasmine/src/templates/example_project_jasmine_tags.html.erb
  152. +0 −7 vendor/jasmine/src/templates/version.js.erb
  153. +0 −6 vendor/jasmine/src/templates/version.rb.erb
  154. +0 −7 vendor/jasmine/src/version.js
  155. +0 −5 vendor/jasmine/src/version.json
  156. +0 −17 vendor/jasmine/tasks/docs.rb
  157. +0 −18 vendor/jasmine/tasks/jasmine_dev.rb
  158. +0 −54 vendor/jasmine/tasks/jasmine_dev/base.rb
  159. +0 −53 vendor/jasmine/tasks/jasmine_dev/build_distribution.rb
  160. +0 −28 vendor/jasmine/tasks/jasmine_dev/build_github_pages.rb
  161. +0 −49 vendor/jasmine/tasks/jasmine_dev/build_standalone_distribution.rb
  162. +0 −59 vendor/jasmine/tasks/jasmine_dev/build_standalone_runner.rb
  163. +0 −29 vendor/jasmine/tasks/jasmine_dev/count_specs.rb
  164. +0 −52 vendor/jasmine/tasks/jasmine_dev/execute_specs.rb
  165. +0 −13 vendor/jasmine/tasks/jasmine_dev/js_hint.rb
  166. +0 −16 vendor/jasmine/tasks/jasmine_dev/release.rb
  167. +0 −32 vendor/jasmine/tasks/jasmine_dev/sources.rb
  168. +0 −62 vendor/jasmine/tasks/jasmine_dev/version.rb
4 CHANGELOG
View
@@ -1,3 +1,7 @@
+v0.2.0:
+ date: 2012-12-03
+ changes:
+ - Generalized requirejs template config, added loader plugin, tests for templates, updated jasmine to 1.3.0
v0.1.2:
date: 2012-11-24
changes:
51 Gruntfile.js
View
@@ -23,36 +23,37 @@ module.exports = function(grunt) {
files: ['test/fixtures/pivotal/**/*.js'],
tasks: 'jasmine:pivotal:build'
},
- connect : {
- test : {
- port : 8000,
- base : '.'
+ connect: {
+ test: {
+ port: 8000,
+ base: '.'
}
},
- jasmine : {
- options : {
- specs : 'test/fixtures/pivotal/spec/*Spec.js',
- helpers : 'test/fixtures/pivotal/spec/*Helper.js'
+ jasmine: {
+ options: {
+ specs: 'test/fixtures/pivotal/spec/*Spec.js',
+ helpers: 'test/fixtures/pivotal/spec/*Helper.js'
},
- pivotal : {
- src : 'test/fixtures/pivotal/src/**/*.js'
+ pivotal: {
+ src: 'test/fixtures/pivotal/src/**/*.js'
},
- customTemplate : {
- src : 'test/fixtures/pivotal/src/**/*.js',
- options : {
- template : 'test/fixtures/customTemplate/custom.tmpl'
+ customTemplate: {
+ src: 'test/fixtures/pivotal/src/**/*.js',
+ options: {
+ template: 'test/fixtures/customTemplate/custom.tmpl'
}
},
- requirejs : {
- src : 'test/fixtures/requirejs/src/**/*.js',
- options : {
- specs : 'test/fixtures/requirejs/spec/*Spec.js',
- helpers : 'test/fixtures/requirejs/spec/*Helper.js',
- host : 'http://127.0.0.1:<%= connect.test.port %>/',
- template : 'requirejs',
- templateOptions : {
- baseUrl : './test/fixtures/requirejs/src/'
-// requirejs : 'vendor/require-2.1.1.js'
+ requirejs: {
+ src: 'test/fixtures/requirejs/src/**/*.js',
+ options: {
+ specs: 'test/fixtures/requirejs/spec/*Spec.js',
+ helpers: 'test/fixtures/requirejs/spec/*Helper.js',
+ host: 'http://127.0.0.1:<%= connect.test.port %>/',
+ template: 'requirejs',
+ templateOptions: {
+ requireConfig : {
+ baseUrl: './test/fixtures/requirejs/src/'
+ }
}
}
}
@@ -72,6 +73,6 @@ module.exports = function(grunt) {
grunt.registerTask('watch-test', ['connect', 'watch']);
- grunt.registerTask('test', ['jasmine:pivotal', 'jasmine:customTemplate', 'connect', 'jasmine:requirejs']);
+ grunt.registerTask('test', ['jasmine:pivotal', 'jasmine:customTemplate', 'connect', 'jasmine:requirejs', 'nodeunit']);
grunt.registerTask('default', ['jshint', 'test', 'build-contrib']);
};
165 README.md
View
@@ -2,31 +2,20 @@
> Run jasmine specs headlessly through PhantomJS.
-_Note that this plugin has not yet been released, and only works with the latest bleeding-edge, in-development version of grunt. See the [When will I be able to use in-development feature 'X'?](https://github.com/gruntjs/grunt/blob/devel/docs/faq.md#when-will-i-be-able-to-use-in-development-feature-x) FAQ entry for more information._
## Getting Started
-_If you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide._
+If you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide, as it explains how to create a [gruntfile][Getting Started] as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:
-From the same directory as your project's [Gruntfile][Getting Started] and [package.json][], install this plugin with the following command:
-
-```bash
+```shell
npm install grunt-contrib-jasmine --save-dev
```
-Once that's done, add this line to your project's Gruntfile:
-
-```js
-grunt.loadNpmTasks('grunt-contrib-jasmine');
-```
-
-If the plugin has been installed correctly, running `grunt --help` at the command line should list the newly-installed plugin's task or tasks. In addition, the plugin should be listed in package.json as a `devDependency`, which ensures that it will be installed whenever the `npm install` command is run.
-
[grunt]: http://gruntjs.com/
[Getting Started]: https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md
-[package.json]: https://npmjs.org/doc/json.html
-## The jasmine task
+## Jasmine task
+_Run this task with the `grunt jasmine` command._
### Overview
@@ -94,13 +83,13 @@ This is the host you want phantomjs to connect against to run your tests.
e.g. if using an ad hoc server from within grunt
```js
- host : 'http://127.0.0.1:8000/'
+host : 'http://127.0.0.1:8000/'
```
Or, using templates
```js
- host : 'http://127.0.0.1:<%= connect.port %>/'
+host : 'http://127.0.0.1:<%= connect.port %>/'
```
Not defining a host will mean your specs will be run from the local filesystem.
@@ -119,35 +108,47 @@ Default: `{}`
These options will be passed to your template as an 'options' hash so that you can provide settings to your template.
-**'requirejs'** default templateOptions :
-
-```js
- requirejs : __dirname + '/../vendor/require-#.#.#.js',
- baseUrl : ''
-```
-
-- requirejs : the location of the included requirejs.
-- baseUrl : set in `require.config({})`, sets the baseUrl for your modules (usually the directory your 'src' files are located in.
-
### Flags
Name: `build`
-Specify this flag in order to rebuild the specrunner and not delete it. This is useful when troublshooting templates,
-running in a browser, or as part of a watch chain for use in a web browser, e.g.
+Turn on this flag in order to rebuild the specrunner without deleting it. This is useful when troublshooting templates,
+running in a browser, or as part of a watch chain e.g.
```js
- watch: {
- pivotal : {
- files: ['test/fixtures/pivotal/**/*.js'],
- tasks: 'jasmine:pivotal:build'
- }
+watch: {
+ pivotal : {
+ files: ['src/**/*.js', 'specs/**/*.js'],
+ tasks: 'jasmine:pivotal:build'
}
+}
```
-```js
- grunt.registerTask('dev', ['connect', 'watch']);
-```
+### Template Options
+
+#### Default template
+
+No specific options are expected or used.
+
+#### RequireJS template
+
+##### templateOptions.requirejs
+Type: `String`
+
+The path to requirejs if you need to specify an alternate version.
+
+##### templateOptions.loaderPlugin
+Type: `String`
+
+The loader plugin to prefix all loaded `src` files. This is useful for processing
+your specs through the likes of CoffeeScript or TypeScript plugins. Keep in mind
+you will need to specify the path to the plugin in the require config.
+
+##### templateOptions.requireConfig
+Type: `Object`
+
+This object is `JSON.stringify()`-ed into the template and passed into `require.config()`
+
@@ -156,12 +157,15 @@ running in a browser, or as part of a watch chain for use in a web browser, e.g.
Sample configuration to run Pivotal Labs' example Jasmine application.
```js
-jasmine : {
- pivotal : {
- src : 'test/fixtures/pivotal/src/**/*.js'
- options : {
- specs : 'test/fixtures/pivotal/spec/*Spec.js',
- helpers : 'test/fixtures/pivotal/spec/*Helper.js'
+// Example configuration
+grunt.initConfig({
+ jasmine: {
+ pivotal: {
+ src: 'src/**/*.js'
+ options: {
+ specs: 'spec/*Spec.js',
+ helpers: 'spec/*Helper.js'
+ }
}
}
}
@@ -172,13 +176,16 @@ jasmine : {
Supplying a custom template to the above example
```js
-jasmine : {
- customTemplate : {
- src : 'test/fixtures/pivotal/src/**/*.js',
- options : {
- specs : 'test/fixtures/pivotal/spec/*Spec.js',
- helpers : 'test/fixtures/pivotal/spec/*Helper.js'
- template : 'test/fixtures/customTemplate/custom.tmpl'
+// Example configuration
+grunt.initConfig({
+ jasmine: {
+ customTemplate: {
+ src: 'src/**/*.js',
+ options: {
+ specs: 'spec/*Spec.js',
+ helpers: 'spec/*Helper.js'
+ template: 'custom.tmpl'
+ }
}
}
}
@@ -187,31 +194,47 @@ jasmine : {
#### Sample RequireJS usage
```js
-jasmine : {
- requirejs : {
- src : 'test/fixtures/requirejs/src/**/*.js',
- options : {
- specs : 'test/fixtures/requirejs/spec/*Spec.js',
- helpers : 'test/fixtures/requirejs/spec/*Helper.js',
- host : 'http://127.0.0.1:8000/', // your connect server config
- template : 'requirejs',
- templateOptions : {
- baseUrl : './test/fixtures/requirejs/src/'
+// Example configuration
+grunt.initConfig({
+ connect: {
+ test : {
+ port : 8000
+ }
+ }
+ jasmine: {
+ requirejs: {
+ src: 'src/**/*.js',
+ options: {
+ specs: 'spec/*Spec.js',
+ helpers: 'spec/*Helper.js',
+ host: 'http://127.0.0.1:8000/',
+ template: 'requirejs',
+ templateOptions: {
+ requireConfig: {
+ baseUrl: 'src/'
+ }
+ }
}
}
}
}
```
+*Note* the usage of the 'connect' task configuration. You will need to use a task like
+[grunt-contrib-connect][] if you need to test your tasks on a running server.
+
+[grunt-contrib-connect]: https://github.com/gruntjs/grunt-contrib-connect
-#### RequireJS note
+#### RequireJS notes
-If you end up using the requirejs template, it's worth looking at the [RequireJS template](https://github.com/gruntjs/grunt-contrib-jasmine/blob/master/tasks/jasmine/templates/RequireJSRunner.tmpl) in order to
-familiarize yourself with how it loads your files. The gist of it is:
+If you end up using the requirejs template, it's worth looking at the
+[RequireJS template source](https://github.com/gruntjs/grunt-contrib-jasmine/blob/master/tasks/jasmine/templates/RequireJSRunner.tmpl)
+in order to familiarize yourself with how it loads your files. The load process essentially
+consists of a series of nested `require` blocks, incrementally loading your source and specs:
```js
require([*YOUR SOURCE*], function() {
require([*YOUR SPECS*], function() {
- require([*JASMINE FILES*], function() {
+ require([*GRUNT-CONTRIB-JASMINE FILES*], function() {
// at this point your tests are already running.
}
}
@@ -221,11 +244,13 @@ require([*YOUR SOURCE*], function() {
## Release History
- * 2012-11-23 - v0.1.2 - Updated for new grunt/grunt-contrib apis
- * 2012-11-06 - v0.1.1 - Fixed race condition in requirejs template
- * 2012-11-06 - v0.1.0 - Ported grunt-jasmine-runner and grunt-jasmine-task to grunt-contrib
+ * 2012-12-02   v0.2.0   Generalized requirejs template config, added loader plugin, tests for templates, updated jasmine to 1.3.0
+ * 2012-11-23   v0.1.2   Updated for new grunt/grunt-contrib apis
+ * 2012-11-06   v0.1.1   Fixed race condition in requirejs template
+ * 2012-11-06   v0.1.0   Ported grunt-jasmine-runner and grunt-jasmine-task to grunt-contrib
+
+---
---
-Task submitted by <a href="http://jarrodoverson.com">Jarrod Overson</a>.
+Task submitted by [Jarrod Overson](http://jarrodoverson.com)
-*Generated on Sat Nov 24 2012 15:36:33.*
+*This file was generated on Mon Dec 03 2012 00:32:53.*
76 docs/jasmine-examples.md
View
@@ -5,12 +5,15 @@
Sample configuration to run Pivotal Labs' example Jasmine application.
```js
-jasmine : {
- pivotal : {
- src : 'test/fixtures/pivotal/src/**/*.js'
- options : {
- specs : 'test/fixtures/pivotal/spec/*Spec.js',
- helpers : 'test/fixtures/pivotal/spec/*Helper.js'
+// Example configuration
+grunt.initConfig({
+ jasmine: {
+ pivotal: {
+ src: 'src/**/*.js'
+ options: {
+ specs: 'spec/*Spec.js',
+ helpers: 'spec/*Helper.js'
+ }
}
}
}
@@ -21,13 +24,16 @@ jasmine : {
Supplying a custom template to the above example
```js
-jasmine : {
- customTemplate : {
- src : 'test/fixtures/pivotal/src/**/*.js',
- options : {
- specs : 'test/fixtures/pivotal/spec/*Spec.js',
- helpers : 'test/fixtures/pivotal/spec/*Helper.js'
- template : 'test/fixtures/customTemplate/custom.tmpl'
+// Example configuration
+grunt.initConfig({
+ jasmine: {
+ customTemplate: {
+ src: 'src/**/*.js',
+ options: {
+ specs: 'spec/*Spec.js',
+ helpers: 'spec/*Helper.js'
+ template: 'custom.tmpl'
+ }
}
}
}
@@ -36,31 +42,47 @@ jasmine : {
## Sample RequireJS usage
```js
-jasmine : {
- requirejs : {
- src : 'test/fixtures/requirejs/src/**/*.js',
- options : {
- specs : 'test/fixtures/requirejs/spec/*Spec.js',
- helpers : 'test/fixtures/requirejs/spec/*Helper.js',
- host : 'http://127.0.0.1:8000/', // your connect server config
- template : 'requirejs',
- templateOptions : {
- baseUrl : './test/fixtures/requirejs/src/'
+// Example configuration
+grunt.initConfig({
+ connect: {
+ test : {
+ port : 8000
+ }
+ }
+ jasmine: {
+ requirejs: {
+ src: 'src/**/*.js',
+ options: {
+ specs: 'spec/*Spec.js',
+ helpers: 'spec/*Helper.js',
+ host: 'http://127.0.0.1:8000/',
+ template: 'requirejs',
+ templateOptions: {
+ requireConfig: {
+ baseUrl: 'src/'
+ }
+ }
}
}
}
}
```
+*Note* the usage of the 'connect' task configuration. You will need to use a task like
+[grunt-contrib-connect][] if you need to test your tasks on a running server.
+
+[grunt-contrib-connect]: https://github.com/gruntjs/grunt-contrib-connect
-## RequireJS note
+## RequireJS notes
-If you end up using the requirejs template, it's worth looking at the [RequireJS template](https://github.com/gruntjs/grunt-contrib-jasmine/blob/master/tasks/jasmine/templates/RequireJSRunner.tmpl) in order to
-familiarize yourself with how it loads your files. The gist of it is:
+If you end up using the requirejs template, it's worth looking at the
+[RequireJS template source](https://github.com/gruntjs/grunt-contrib-jasmine/blob/master/tasks/jasmine/templates/RequireJSRunner.tmpl)
+in order to familiarize yourself with how it loads your files. The load process essentially
+consists of a series of nested `require` blocks, incrementally loading your source and specs:
```js
require([*YOUR SOURCE*], function() {
require([*YOUR SPECS*], function() {
- require([*JASMINE FILES*], function() {
+ require([*GRUNT-CONTRIB-JASMINE FILES*], function() {
// at this point your tests are already running.
}
}
56 docs/jasmine-options.md
View
@@ -37,13 +37,13 @@ This is the host you want phantomjs to connect against to run your tests.
e.g. if using an ad hoc server from within grunt
```js
- host : 'http://127.0.0.1:8000/'
+host : 'http://127.0.0.1:8000/'
```
Or, using templates
```js
- host : 'http://127.0.0.1:<%= connect.port %>/'
+host : 'http://127.0.0.1:<%= connect.port %>/'
```
Not defining a host will mean your specs will be run from the local filesystem.
@@ -62,32 +62,44 @@ Default: `{}`
These options will be passed to your template as an 'options' hash so that you can provide settings to your template.
-**'requirejs'** default templateOptions :
-
-```js
- requirejs : __dirname + '/../vendor/require-#.#.#.js',
- baseUrl : ''
-```
-
-- requirejs : the location of the included requirejs.
-- baseUrl : set in `require.config({})`, sets the baseUrl for your modules (usually the directory your 'src' files are located in.
-
# Flags
Name: `build`
-Specify this flag in order to rebuild the specrunner and not delete it. This is useful when troublshooting templates,
-running in a browser, or as part of a watch chain for use in a web browser, e.g.
+Turn on this flag in order to rebuild the specrunner without deleting it. This is useful when troublshooting templates,
+running in a browser, or as part of a watch chain e.g.
```js
- watch: {
- pivotal : {
- files: ['test/fixtures/pivotal/**/*.js'],
- tasks: 'jasmine:pivotal:build'
- }
+watch: {
+ pivotal : {
+ files: ['src/**/*.js', 'specs/**/*.js'],
+ tasks: 'jasmine:pivotal:build'
}
+}
```
-```js
- grunt.registerTask('dev', ['connect', 'watch']);
-```
+# Template Options
+
+## Default template
+
+No specific options are expected or used.
+
+## RequireJS template
+
+### templateOptions.requirejs
+Type: `String`
+
+The path to requirejs if you need to specify an alternate version.
+
+### templateOptions.loaderPlugin
+Type: `String`
+
+The loader plugin to prefix all loaded `src` files. This is useful for processing
+your specs through the likes of CoffeeScript or TypeScript plugins. Keep in mind
+you will need to specify the path to the plugin in the require config.
+
+### templateOptions.requireConfig
+Type: `Object`
+
+This object is `JSON.stringify()`-ed into the template and passed into `require.config()`
+
3  package.json
View
@@ -1,7 +1,7 @@
{
"name": "grunt-contrib-jasmine",
"description": "Run jasmine specs headlessly through PhantomJS.",
- "version": "0.1.1",
+ "version": "0.2.0",
"homepage": "https://github.com/gruntjs/grunt-contrib-jasmine",
"author": {
"name": "Grunt Team",
@@ -36,7 +36,6 @@
"grunt-contrib-nodeunit": "~0.1.1",
"grunt-contrib-jshint": "~0.1.0",
"grunt-contrib-watch": "~0.1.4",
- "grunt-lib-phantomjs": "~0.1.0",
"grunt": "~0.4.0a"
},
"keywords": [
18 tasks/jasmine/templates/RequireJSRunner.tmpl
View
@@ -5,28 +5,30 @@
<title>Jasmine Spec Runner</title>
<script src="<%= options.requirejs %>"></script>
<script>
- require.config({
- baseUrl : '<%= options.baseUrl %>'
- });
+ <% if (options.requireConfig) { %>
+ require.config(<%= JSON.stringify(options.requireConfig) %>);
+ <% } %>
</script>
<% css.forEach(function(style){ %>
<link rel="stylesheet" type="text/css" href="<%= style %>">
<% }) %>
<% with (scripts) { %>
- <% [].concat(jasmine, vendor, helpers).forEach(function(script){ %>
- <script src="<%= script %>"></script>
- <% }) %>
+ <% [].concat(jasmine, vendor, helpers).forEach(function(script){ %>
+ <script src="<%= script %>"></script>
+ <% }) %>
<% }; %>
<script>
require([
<% scripts.src.forEach(function(script, i){ %>
- '<%= script.replace(new RegExp('^' + options.baseUrl),"").replace(/\.js$/,"") %>' <% if (i !== scripts.src.length-1){ %>,<% } %>
+ <% if (options.requireConfig && options.requireConfig.baseUrl) script = script.replace(new RegExp('^' + options.requireConfig.baseUrl),""); %>
+ <% if (options.loaderPlugin) script = options.loaderPlugin + '!' + script %>
+ '<%= script.replace(/\.js$/,"") %>' <%= i < scripts.src.length-1 ? ',' : '' %>
<% }) %>
],
function(){
require(['<%= [].concat(scripts.specs,scripts.reporters).join("','") %>'], function(){
require(['<%= scripts.start.join("','") %>'], function(){
- // good to go!
+ // good to go! Our tests should already be running.
})
})
}
6 tasks/lib/jasmine.js
View
@@ -16,12 +16,12 @@ function buildSpecrunner(src, options){
];
var jasmineCss = [
- __dirname + '/../../vendor/jasmine/lib/jasmine-core/jasmine.css'
+ __dirname + '/../../vendor/jasmine-1.3.0/jasmine.css'
];
var jasmineCore = [
- __dirname + '/../../vendor/jasmine/lib/jasmine-core/jasmine.js',
- __dirname + '/../../vendor/jasmine/lib/jasmine-core/jasmine-html.js'
+ __dirname + '/../../vendor/jasmine-1.3.0/jasmine.js',
+ __dirname + '/../../vendor/jasmine-1.3.0/jasmine-html.js'
];
var jasmineHelper = __dirname + '/../jasmine/jasmine-helper.js';
34 test/expected/basicRequireJSTemplate.html
View
@@ -0,0 +1,34 @@
+<!doctype html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>Jasmine Spec Runner</title>
+ <script src=""></script>
+ <script>
+ </script>
+
+ <link rel="stylesheet" type="text/css" href="css/a.css">
+ <script src="J1.js"></script>
+ <script src="J2.js"></script>
+ <script src="V1.js"></script>
+ <script src="V2.js"></script>
+ <script src="H1.js"></script>
+ <script src="H2.js"></script>
+ <script>
+ require([
+ 'foo/bar/SRC1',
+ 'foo/bar/SRC2'
+ ],
+ function(){
+ require(['SPEC1.js','SPEC2.js','R1.js'], function(){
+ require(['START.js'], function(){
+ // good to go! Our tests should already be running.
+ })
+ })
+ }
+ )
+ </script>
+</head>
+<body>
+</body>
+</html>
24 test/expected/defaultTemplate.html
View
@@ -0,0 +1,24 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Jasmine Spec Runner</title>
+
+ <link rel="stylesheet" type="text/css" href="css/a.css">
+
+ <script src="J1.js"></script>
+ <script src="J2.js"></script>
+ <script src="V1.js"></script>
+ <script src="V2.js"></script>
+ <script src="H1.js"></script>
+ <script src="H2.js"></script>
+ <script src="SRC1.js"></script>
+ <script src="SRC2.js"></script>
+ <script src="SPEC1.js"></script>
+ <script src="SPEC2.js"></script>
+ <script src="R1.js"></script>
+ <script src="START.js"></script>
+ </head>
+ <body>
+ </body>
+</html>
40 test/expected/requireJSTemplate.html
View
@@ -0,0 +1,40 @@
+<!doctype html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>Jasmine Spec Runner</title>
+ <script src="path/to/require.js"></script>
+ <script>
+ require.config({
+ "baseUrl" : "foo/bar/",
+ "paths" : {
+ "cs" : "plugins/cs"
+ }
+ });
+ </script>
+
+ <link rel="stylesheet" type="text/css" href="css/a.css">
+ <script src="J1.js"></script>
+ <script src="J2.js"></script>
+ <script src="V1.js"></script>
+ <script src="V2.js"></script>
+ <script src="H1.js"></script>
+ <script src="H2.js"></script>
+ <script>
+ require([
+ 'cs!SRC1' ,
+ 'cs!SRC2'
+ ],
+ function(){
+ require(['SPEC1.js','SPEC2.js','R1.js'], function(){
+ require(['START.js'], function(){
+ // good to go! Our tests should already be running.
+ })
+ })
+ }
+ )
+ </script>
+</head>
+<body>
+</body>
+</html>
93 test/jasmine_test.js
View
@@ -5,9 +5,98 @@ var grunt = require('grunt');
// Majority of test benefit comes from running the task itself.
// This is kept around for future use.
+function runTemplate(src,context) {
+ var source = grunt.file.read(src);
+ return grunt.util._.template(source, context);
+}
+
+// Just strips whitespace for now. Should do a proper min of everything
+// but this is working well enough for now.
+function normalize(html) {
+ return html.replace(/\s*/g,'');
+}
+
exports.jasmine = {
- request: function(test) {
- test.expect(0);
+ defaultTemplate: function(test) {
+ test.expect(1);
+
+ var context = {
+ css : ['css/a.css'],
+ scripts : {
+ jasmine : ['J1.js','J2.js'],
+ helpers : ['H1.js','H2.js'],
+ specs : ['SPEC1.js','SPEC2.js'],
+ src : ['SRC1.js','SRC2.js'],
+ vendor : ['V1.js','V2.js'],
+ reporters : ['R1.js'],
+ start : ['START.js']
+ },
+ options : {}
+ };
+
+ var actual = runTemplate('./tasks/jasmine/templates/DefaultRunner.tmpl', context);
+ var expected = grunt.file.read('./test/expected/defaultTemplate.html');
+
+ test.equal(normalize(actual),normalize(expected), 'default test runner template');
+
+ test.done();
+ },
+ basicRequireJsTemplate: function(test) {
+ test.expect(1);
+
+ var context = {
+ css : ['css/a.css'],
+ scripts : {
+ jasmine : ['J1.js','J2.js'],
+ helpers : ['H1.js','H2.js'],
+ specs : ['SPEC1.js','SPEC2.js'],
+ src : ['foo/bar/SRC1.js','foo/bar/SRC2.js'],
+ vendor : ['V1.js','V2.js'],
+ reporters : ['R1.js'],
+ start : ['START.js']
+ },
+ options : {
+ }
+ };
+
+ var actual = runTemplate('./tasks/jasmine/templates/RequireJSRunner.tmpl', context);
+ var expected = grunt.file.read('./test/expected/basicRequireJSTemplate.html');
+
+ test.equal(normalize(actual),normalize(expected), 'default test runner template');
+
+ test.done();
+ },
+ requireJsTemplate: function(test) {
+ test.expect(1);
+
+ var context = {
+ css : ['css/a.css'],
+ scripts : {
+ jasmine : ['J1.js','J2.js'],
+ helpers : ['H1.js','H2.js'],
+ specs : ['SPEC1.js','SPEC2.js'],
+ src : ['foo/bar/SRC1.js','foo/bar/SRC2.js'],
+ vendor : ['V1.js','V2.js'],
+ reporters : ['R1.js'],
+ start : ['START.js']
+ },
+ options : {
+ requirejs : 'path/to/require.js',
+ loaderPlugin : 'cs',
+ requireConfig : {
+ baseUrl : 'foo/bar/',
+ paths : {
+ cs : 'plugins/cs'
+ }
+ }
+ }
+ };
+
+ var actual = runTemplate('./tasks/jasmine/templates/RequireJSRunner.tmpl', context);
+ var expected = grunt.file.read('./test/expected/requireJSTemplate.html');
+
+ test.equal(normalize(actual),normalize(expected), 'default test runner template');
+
test.done();
}
};
0  vendor/jasmine/MIT.LICENSE → vendor/jasmine-1.3.0/MIT.LICENSE
View
File renamed without changes
2  vendor/jasmine/lib/jasmine-core/jasmine-html.js → vendor/jasmine-1.3.0/jasmine-html.js
View
@@ -154,7 +154,7 @@ jasmine.HtmlReporter = function(_doc) {
dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}),
dom.alert = self.createDom('div', {className: 'alert'},
self.createDom('span', { className: 'exceptions' },
- self.createDom('label', { className: 'label', 'for': 'no_try_catch' }, 'No try/catch'),
+ self.createDom('label', { className: 'label', for: 'no_try_catch' }, 'No try/catch'),
self.createDom('input', { id: 'no_try_catch', type: 'checkbox' }))),
dom.results = self.createDom('div', {className: 'results'},
dom.summary = self.createDom('div', { className: 'summary' }),
0  vendor/jasmine/src/html/jasmine.css → vendor/jasmine-1.3.0/jasmine.css
View
File renamed without changes
116 vendor/jasmine/lib/jasmine-core/jasmine.js → vendor/jasmine-1.3.0/jasmine.js
View
@@ -1,4 +1,4 @@
-var isCommonJS = typeof window == "undefined";
+var isCommonJS = typeof window == "undefined" && typeof exports == "object";
/**
* Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
@@ -35,6 +35,11 @@ jasmine.VERBOSE = false;
jasmine.DEFAULT_UPDATE_INTERVAL = 250;
/**
+ * Maximum levels of nesting that will be included when an object is pretty-printed
+ */
+jasmine.MAX_PRETTY_PRINT_DEPTH = 40;
+
+/**
* Default timeout interval in milliseconds for waitsFor() blocks.
*/
jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
@@ -470,7 +475,7 @@ jasmine.log = function() {
* @see jasmine.createSpy
* @param obj
* @param methodName
- * @returns a Jasmine spy that can be chained with all spy methods
+ * @return {jasmine.Spy} a Jasmine spy that can be chained with all spy methods
*/
var spyOn = function(obj, methodName) {
return jasmine.getEnv().currentSpec.spyOn(obj, methodName);
@@ -515,6 +520,7 @@ if (isCommonJS) exports.xit = xit;
* jasmine.Matchers functions.
*
* @param {Object} actual Actual value to test against and expected value
+ * @return {jasmine.Matchers}
*/
var expect = function(actual) {
return jasmine.getEnv().currentSpec.expect(actual);
@@ -874,6 +880,25 @@ jasmine.Env.prototype.xit = function(desc, func) {
};
};
+jasmine.Env.prototype.compareRegExps_ = function(a, b, mismatchKeys, mismatchValues) {
+ if (a.source != b.source)
+ mismatchValues.push("expected pattern /" + b.source + "/ is not equal to the pattern /" + a.source + "/");
+
+ if (a.ignoreCase != b.ignoreCase)
+ mismatchValues.push("expected modifier i was" + (b.ignoreCase ? " " : " not ") + "set and does not equal the origin modifier");
+
+ if (a.global != b.global)
+ mismatchValues.push("expected modifier g was" + (b.global ? " " : " not ") + "set and does not equal the origin modifier");
+
+ if (a.multiline != b.multiline)
+ mismatchValues.push("expected modifier m was" + (b.multiline ? " " : " not ") + "set and does not equal the origin modifier");
+
+ if (a.sticky != b.sticky)
+ mismatchValues.push("expected modifier y was" + (b.sticky ? " " : " not ") + "set and does not equal the origin modifier");
+
+ return (mismatchValues.length === 0);
+};
+
jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) {
if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) {
return true;
@@ -960,6 +985,10 @@ jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) {
return (a == b);
}
+ if (a instanceof RegExp && b instanceof RegExp) {
+ return this.compareRegExps_(a, b, mismatchKeys, mismatchValues);
+ }
+
if (typeof a === "object" && typeof b === "object") {
return this.compareObjects_(a, b, mismatchKeys, mismatchValues);
}
@@ -1294,6 +1323,17 @@ jasmine.Matchers.prototype.toBeNull = function() {
};
/**
+ * Matcher that compares the actual to NaN.
+ */
+jasmine.Matchers.prototype.toBeNaN = function() {
+ this.message = function() {
+ return [ "Expected " + jasmine.pp(this.actual) + " to be NaN." ];
+ };
+
+ return (this.actual !== this.actual);
+};
+
+/**
* Matcher that boolean not-nots the actual.
*/
jasmine.Matchers.prototype.toBeTruthy = function() {
@@ -1370,18 +1410,14 @@ jasmine.Matchers.prototype.toHaveBeenCalledWith = function() {
throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
}
this.message = function() {
+ var invertedMessage = "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but it was.";
+ var positiveMessage = "";
if (this.actual.callCount === 0) {
- // todo: what should the failure message for .not.toHaveBeenCalledWith() be? is this right? test better. [xw]
- return [
- "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but it was never called.",
- "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but it was."
- ];
+ positiveMessage = "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but it was never called.";
} else {
- return [
- "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall),
- "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall)
- ];
+ positiveMessage = "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but actual calls were " + jasmine.pp(this.actual.argsForCall).replace(/^\[ | \]$/g, '')
}
+ return [positiveMessage, invertedMessage];
};
return this.env.contains_(this.actual.argsForCall, expectedArgs);
@@ -1439,7 +1475,7 @@ jasmine.Matchers.prototype.toBeGreaterThan = function(expected) {
* up to a given level of decimal precision (default 2).
*
* @param {Number} expected
- * @param {Number} precision
+ * @param {Number} precision, as number of decimal places
*/
jasmine.Matchers.prototype.toBeCloseTo = function(expected, precision) {
if (!(precision === 0)) {
@@ -1451,7 +1487,7 @@ jasmine.Matchers.prototype.toBeCloseTo = function(expected, precision) {
/**
* Matcher that checks that the expected exception was thrown by the actual.
*
- * @param {String} expected
+ * @param {String} [expected]
*/
jasmine.Matchers.prototype.toThrow = function(expected) {
var result = false;
@@ -1849,10 +1885,6 @@ jasmine.PrettyPrinter = function() {
* @param value
*/
jasmine.PrettyPrinter.prototype.format = function(value) {
- if (this.ppNestLevel_ > 40) {
- throw new Error('jasmine.PrettyPrinter: format() nested too deeply!');
- }
-
this.ppNestLevel_++;
try {
if (value === jasmine.undefined) {
@@ -1895,6 +1927,7 @@ jasmine.PrettyPrinter.prototype.format = function(value) {
jasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) {
for (var property in obj) {
+ if (!obj.hasOwnProperty(property)) continue;
if (property == '__Jasmine_been_here_before__') continue;
fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) !== jasmine.undefined &&
obj.__lookupGetter__(property) !== null) : false);
@@ -1922,6 +1955,11 @@ jasmine.StringPrettyPrinter.prototype.emitString = function(value) {
};
jasmine.StringPrettyPrinter.prototype.emitArray = function(array) {
+ if (this.ppNestLevel_ > jasmine.MAX_PRETTY_PRINT_DEPTH) {
+ this.append("Array");
+ return;
+ }
+
this.append('[ ');
for (var i = 0; i < array.length; i++) {
if (i > 0) {
@@ -1933,6 +1971,11 @@ jasmine.StringPrettyPrinter.prototype.emitArray = function(array) {
};
jasmine.StringPrettyPrinter.prototype.emitObject = function(obj) {
+ if (this.ppNestLevel_ > jasmine.MAX_PRETTY_PRINT_DEPTH) {
+ this.append("Object");
+ return;
+ }
+
var self = this;
this.append('{ ');
var first = true;
@@ -1961,6 +2004,10 @@ jasmine.StringPrettyPrinter.prototype.append = function(value) {
};
jasmine.Queue = function(env) {
this.env = env;
+
+ // parallel to blocks. each true value in this array means the block will
+ // get executed even if we abort
+ this.ensured = [];
this.blocks = [];
this.running = false;
this.index = 0;
@@ -1968,15 +2015,30 @@ jasmine.Queue = function(env) {
this.abort = false;
};
-jasmine.Queue.prototype.addBefore = function(block) {
+jasmine.Queue.prototype.addBefore = function(block, ensure) {
+ if (ensure === jasmine.undefined) {
+ ensure = false;
+ }
+
this.blocks.unshift(block);
+ this.ensured.unshift(ensure);
};
-jasmine.Queue.prototype.add = function(block) {
+jasmine.Queue.prototype.add = function(block, ensure) {
+ if (ensure === jasmine.undefined) {
+ ensure = false;
+ }
+
this.blocks.push(block);
+ this.ensured.push(ensure);
};
-jasmine.Queue.prototype.insertNext = function(block) {
+jasmine.Queue.prototype.insertNext = function(block, ensure) {
+ if (ensure === jasmine.undefined) {
+ ensure = false;
+ }
+
+ this.ensured.splice((this.index + this.offset + 1), 0, ensure);
this.blocks.splice((this.index + this.offset + 1), 0, block);
this.offset++;
};
@@ -2000,7 +2062,7 @@ jasmine.Queue.prototype.next_ = function() {
while (goAgain) {
goAgain = false;
- if (self.index < self.blocks.length && !this.abort) {
+ if (self.index < self.blocks.length && !(this.abort && !this.ensured[self.index])) {
var calledSynchronously = true;
var completedSynchronously = false;
@@ -2291,7 +2353,7 @@ jasmine.Spec.prototype.finish = function(onComplete) {
jasmine.Spec.prototype.after = function(doAfter) {
if (this.queue.isRunning()) {
- this.queue.add(new jasmine.Block(this.env, doAfter, this));
+ this.queue.add(new jasmine.Block(this.env, doAfter, this), true);
} else {
this.afterCallbacks.unshift(doAfter);
}
@@ -2329,15 +2391,15 @@ jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() {
this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this));
}
for (i = 0; i < this.afterCallbacks.length; i++) {
- this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this));
+ this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this), true);
}
for (suite = this.suite; suite; suite = suite.parentSuite) {
for (i = 0; i < suite.after_.length; i++) {
- this.queue.add(new jasmine.Block(this.env, suite.after_[i], this));
+ this.queue.add(new jasmine.Block(this.env, suite.after_[i], this), true);
}
}
for (i = 0; i < runner.after_.length; i++) {
- this.queue.add(new jasmine.Block(this.env, runner.after_[i], this));
+ this.queue.add(new jasmine.Block(this.env, runner.after_[i], this), true);
}
};
@@ -2532,7 +2594,7 @@ jasmine.WaitsForBlock.prototype.execute = function(onComplete) {
jasmine.version_= {
"major": 1,
- "minor": 2,
+ "minor": 3,
"build": 0,
- "revision": 1343710612
+ "revision": 1354052693
};
2  vendor/jasmine/.rspec
View
@@ -1,2 +0,0 @@
---color
---format Fuubar
45 vendor/jasmine/Contribute.markdown
View
@@ -1,45 +0,0 @@
-# Developing for Jasmine Core
-
-## How to Contribute
-
-We welcome your contributions - Thanks for helping make Jasmine a better project for everyone. Please review the backlog and discussion lists (the main group - [http://groups.google.com/group/jasmine-js](http://groups.google.com/group/jasmine-js) and the developer's list - [http://groups.google.com/group/jasmine-js-dev](http://groups.google.com/group/jasmine-js-dev)) before starting work - what you're looking for may already have been done. If it hasn't, the community can help make your contribution better.
-
-## How to write new Jasmine code
-
-Or, How to make a successful pull request
-
-* _Do not change the public interface_. Lots of projects depend on Jasmine and if you aren't careful you'll break them
-* _Be environment agnostic_ - server-side developers are just as important as browser developers
-* _Be browser agnostic_ - if you must rely on browser-specific functionality, please write it in a way that degrades gracefully
-* _Write specs_ - Jasmine's a testing framework; don't add functionality without test-driving it
-* _Ensure the *entire* test suite is green_ in all the big browsers, Node, and JSHint - your contribution shouldn't break Jasmine for other users
-
-Follow these tips and your pull request, patch, or suggestion is much more likely to be integrated.
-
-## Environment
-
-Ruby, RubyGems and Rake are used in order to script the various file interactions. You will need to run on a system that supports Ruby in order to run Jasmine's specs.
-
-Node.js is used to run most of the specs (the HTML-independent code) and should be present. Additionally, the JS Hint project scrubs the source code as part of the spec process.
-
-## Development
-
-All source code belongs in `src/`. The `core/` directory contains the bulk of Jasmine's functionality. This code should remain browser- and environment-agnostic. If your feature or fix cannot be, as mentioned above, please degrade gracefully. Any code that should only be in a non-browser environment should live in `src/console/`. Any code that depends on a browser (specifically, it expects `window` to be the global or `document` is present) should live in `src/html/`.
-
-Please respect the code patterns as possible. For example, using `jasmine.getGlobal()` to get the global object so as to remain environment agnostic.
-
-## Running Specs
-
-As in all good projects, the `spec/` directory mirrors `src/` and follows the same rules. The browser runner will include and attempt to run all specs. The node runner will exclude any html-dependent specs (those in `spec/html/`).
-
-You will notice that all specs are run against the built `jasmine.js` instead of the component source files. This is intentional as a way to ensure that the concatenation code is working correctly.
-
-Please ensure all specs are green before committing or issuing a pull request.
-
-There are Thor tasks to help with getting green - run `thor list` to see them all. Here are the key tasks:
-
-* `thor jasmine_dev:execute_specs` outputs the expected number of specs that should be run and attempts to run in browser and Node
-* `thor jasmine_dev:execute_specs_in_browser` opens `spec/runner.html` in the default browser on MacOS. Please run this in at least Firefox and Chrome before committing
-* `thor jasmine_dev:execute_specs_in_node` runs all the Jasmine specs in Node.js - it will complain if Node is not installed
-* `thor jasmine_dev:js_hint` runs all the files through JSHint and will complain about potential viable issues with your code. Fix them.
-
3  vendor/jasmine/Gemfile
View
@@ -1,3 +0,0 @@
-source :rubygems
-gem "rake"
-gemspec
24 vendor/jasmine/README.markdown
View
@@ -1,24 +0,0 @@
-<a name="README">[Jasmine](http://pivotal.github.com/jasmine/)</a>
-=======
-**A JavaScript Testing Framework**
-
-Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on browsers, DOM, or any JavaScript framework. Thus it's suited for websites, [Node.js](http://nodejs.org) projects, or anywhere that JavaScript can run.
-
-Documentation & guides live here: [http://pivotal.github.com/jasmine/](http://pivotal.github.com/jasmine/)
-
-
-## Support
-
-* Search past discussions: [http://groups.google.com/group/jasmine-js](http://groups.google.com/group/jasmine-js)
-* Send an email to the list: [jasmine-js@googlegroups.com](jasmine-js@googlegroups.com)
-* View the project backlog at Pivotal Tracker: [http://www.pivotaltracker.com/projects/10606](http://www.pivotaltracker.com/projects/10606)
-* Follow us on Twitter: [@JasmineBDD](http://twitter.com/JasmineBDD)
-
-
-## Maintainers
-
-* [Davis W. Frank](mailto:dwfrank@pivotallabs.com), Pivotal Labs
-* [Rajan Agaskar](mailto:rajan@pivotallabs.com), Pivotal Labs
-* [Christian Williams](mailto:antixian666@gmail.com), Square
-
-Copyright (c) 2008-2012 Pivotal Labs. This software is licensed under the MIT License.
44 vendor/jasmine/Rakefile
View
@@ -1,44 +0,0 @@
-require "bundler"
-Bundler::GemHelper.install_tasks
-require "json"
-require "tilt"
-
-Dir["#{File.dirname(__FILE__)}/tasks/**/*.rb"].each do |file|
- require file
-end
-
-desc "Run all Jasmine JS specs"
-task :jasmine_specs do
- jasmine_dev = JasmineDev.new
-
- return unless jasmine_dev.node_installed?
-
- system "thor jasmine_dev:execute_specs"
-
- puts "\n\033[33m>>> DEPRECATED <<< Run Jasmine's JavaScript specs with 'thor jasmine_dev:execute_specs'\n\033[0m"
-end
-
-desc "Run all Jasmine core tests (JavaScript and dev tasks)"
-task :spec => :require_pages_submodule do
- jasmine_dev = JasmineDev.new
-
- return unless jasmine_dev.node_installed?
-
- system "rspec"
-end
-
-task :require_pages_submodule do
- jasmine_dev = JasmineDev.new
-
- unless jasmine_dev.pages_submodule_installed?
- puts 'Installing the Github pages submodule:'
- system 'git submodule update --init'
- puts 'Now continuing...'
- end
-end
-
-desc "View full development tasks"
-task :list_dev_tasks do
- puts "Jasmine uses Thor for command line tasks for development. Here is the command set:"
- system "thor list"
-end
42 vendor/jasmine/Release.markdown
View
@@ -1,42 +0,0 @@
-# How to work on a Jasmine Release
-
-## Development
-___Jasmine Core Maintainers Only___
-
-Follow the instructions in `Contribute.markdown` during development.
-
-### Git Rules
-
-Please work on feature branches.
-
-Please attempt to keep commits to `master` small, but cohesive. If a feature is contained in a bunch of small commits (e.g., it has several wip commits), please squash them when merging back to `master`.
-
-### Version
-
-We attempt to stick to [Semantic Versioning](). Most of the time, development should be against a new minor version - fixing bugs and adding new features that are backwards compatible.
-
-The current version lives in the file `src/version.json`. This file should be set to the version that is _currently_ under development. That is, if version 1.0.0 is the current release then version should be incremented say, to 1.1.0.
-
-This version is used by both `jasmine.js` and the `jasmine-core` Ruby gem.
-
-Note that Jasmine should *not* use the "patch" version number. Let downstream projects rev their patch versions as needed, keeping their major and minor version numbers in sync with Jasmine core.
-
-### Update the Github Pages (as needed)
-
-Github pages have to exist in a branch called `gh-pages` in order for their app to serve them. This repo adds that branch as a submodule under the `pages` directory. This is a bit of a hack, but it allows us to work with the pages and the source at the same time and with one set of rake tasks.
-
-If you want to submit changes to this repo and aren't a Pivotal Labs employee, you can fork and work in the `gh-pages` branch. You won't be able to edit the pages in the submodule off of master.
-
-The pages are built with [Frank](https://github.com/blahed/frank). All the source for these pages live in the `pages/pages_source` directory.
-
-## Release
-
-When ready to release - specs are all green and the stories are done:
-
-1. Update the version in `version.json` to a release candidate - add a `release_candidate` property with a value of 1
-1. Update any comments on the public interfaces
-1. Update any links or top-level landing page for the Github Pages
-1. `thor jasmine_dev:release_prep` - updates the version, builds the `.js` files, builds the standalone release, and builds the Github pages
-1. `rake release` - tags the repo with the version, builds the `jasmine-core` gem, pushes the gem to Rubygems.org
-
-There should be a post to Pivotal Labs blog and a tweet to that link.
15 vendor/jasmine/SpecRunner.html
View
@@ -1,15 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
- <title>Jasmine Spec Runner</title>
-
- <link rel="stylesheet" type="text/css" href="lib/jasmine-core/jasmine.css">
- <script type="text/javascript" src="lib/jasmine-core/jasmine.js"></script>
- <script type="text/javascript" src="lib/jasmine-core/jasmine-html.js"></script>
-
-</head>
-
-<body>
-</body>
-</html>
29 vendor/jasmine/config.rb
View
@@ -1,29 +0,0 @@
-#
-# Compass configuration file - for building Jasmine's 'final CSS files
-#
-
-# Require any additional compass plugins here.
-
-# Set this to the root of your project when deployed:
-http_path = "/"
-css_dir = "src/html"
-sass_dir = "src/html"
-images_dir = "images"
-javascripts_dir = "javascripts"
-
-# You can select your preferred output style here (can be overridden via the command line):
-# output_style = :expanded or :nested or :compact or :compressed
-output_style = :compact
-
-# To enable relative paths to assets via compass helper functions. Uncomment:
-# relative_assets = true
-
-# To disable debugging comments that display the original location of your selectors. Uncomment:
-line_comments = false
-
-
-# If you prefer the indented syntax, you might want to regenerate this
-# project again passing --syntax sass, or you can uncomment this:
-# preferred_syntax = :sass
-# and then run:
-# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
BIN  vendor/jasmine/images/jasmine_favicon.png
View
Deleted file not rendered
32 vendor/jasmine/jasmine-core.gemspec
View
@@ -1,32 +0,0 @@
-# -*- encoding: utf-8 -*-
-$:.push File.expand_path("../lib", __FILE__)
-require "jasmine-core/version"
-
-Gem::Specification.new do |s|
- s.name = "jasmine-core"
- s.version = Jasmine::Core::VERSION
- s.platform = Gem::Platform::RUBY
- s.authors = ["Rajan Agaskar", "Davis W. Frank", "Christian Williams"]
- s.summary = %q{JavaScript BDD framework}
- s.description = %q{Test your JavaScript without any framework dependencies, in any environment, and with a nice descriptive syntax.}
- s.email = %q{jasmine-js@googlegroups.com}
- s.homepage = "http://pivotal.github.com/jasmine"
- s.rubyforge_project = "jasmine-core"
- s.license = "MIT"
-
- s.files = Dir.glob("./lib/**/*") + Dir.glob("./lib/jasmine-core/spec/**/*.js")
- s.require_paths = ["lib"]
- s.add_development_dependency "json_pure", ">= 1.4.3"
- s.add_development_dependency "tilt"
- s.add_development_dependency "sass"
- s.add_development_dependency "compass"
- s.add_development_dependency "ragaskar-jsdoc_helper"
- s.add_development_dependency "rspec"
- s.add_development_dependency "fuubar"
- s.add_development_dependency "awesome_print"
- s.add_development_dependency "thor"
- s.add_development_dependency "nokogiri"
- s.add_development_dependency "redcarpet", "1.7"
- s.add_development_dependency "rocco"
- s.add_development_dependency "rdiscount"
-end
1  vendor/jasmine/jasmine_dev.thor
View
@@ -1 +0,0 @@
-require "#{File.expand_path(File.dirname(__FILE__))}/tasks/jasmine_dev"
17 vendor/jasmine/jsdoc-template/allclasses.tmpl
View
@@ -1,17 +0,0 @@
-<div align="center">{+new Link().toFile("index.html").withText("Class Index")+}
-| {+new Link().toFile("files.html").withText("File Index")+}</div>
-<hr />
-<h2>Classes</h2>
-<ul class="classList">
- <for each="thisClass" in="data">
- <li>{!
- if (thisClass.alias == "_global_") {
- output += "<i>"+new Link().toClass(thisClass.alias)+"</i>";
- }
- else {
- output += new Link().toClass(thisClass.alias);
- }
- !}</li>
- </for>
-</ul>
-<hr />
56 vendor/jasmine/jsdoc-template/allfiles.tmpl
View
@@ -1,56 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}"" />
- {! Link.base = ""; /* all generated links will be relative to this */ !}
- <title>JsDoc Reference - File Index</title>
- <meta name="generator" content="JsDoc Toolkit" />
-
- <style type="text/css">
- {+include("static/default.css")+}
- </style>
- </head>
-
- <body>
- {+include("static/header.html")+}
-
- <div id="index">
- {+publish.classesIndex+}
- </div>
-
- <div id="content">
- <h1 class="classTitle">File Index</h1>
-
- <for each="item" in="data">
- <div>
- <h2>{+new Link().toSrc(item.alias).withText(item.name)+}</h2>
- <if test="item.desc">{+resolveLinks(summarize(item.desc))+}</if>
- <dl>
- <if test="item.author">
- <dt class="heading">Author:</dt>
- <dd>{+item.author+}</dd>
- </if>
- <if test="item.version">
- <dt class="heading">Version:</dt>
- <dd>{+item.version+}</dd>
- </if>
- {! var locations = item.comment.getTag('location').map(function($){return $.toString().replace(/(^\$ ?| ?\$$)/g, '').replace(/^HeadURL: https:/g, 'http:');}) !}
- <if test="locations.length">
- <dt class="heading">Location:</dt>
- <for each="location" in="locations">
- <dd><a href="{+location+}">{+location+}</a></dd>
- </for>
- </if>
- </dl>
- </div>
- <hr />
- </for>
-
- </div>
- <div class="fineprint" style="clear:both">
- <if test="JSDOC.opt.D.copyright">&copy;{+JSDOC.opt.D.copyright+}<br /></if>
- Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> {+JSDOC.VERSION+} on {+new Date()+}
- </div>
- </body>
-</html>
646 vendor/jasmine/jsdoc-template/class.tmpl
View
@@ -1,646 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}" />
- <meta name="generator" content="JsDoc Toolkit" />
- {! Link.base = "../"; /* all generated links will be relative to this */ !}
- <title>JsDoc Reference - {+data.alias+}</title>
-
- <style type="text/css">
- {+include("static/default.css")+}
- </style>
- </head>
-
- <body>
-<!-- ============================== header ================================= -->
- <!-- begin static/header.html -->
- {+include("static/header.html")+}
- <!-- end static/header.html -->
-
-<!-- ============================== classes index ============================ -->
- <div id="index">
- <!-- begin publish.classesIndex -->
- {+publish.classesIndex+}
- <!-- end publish.classesIndex -->
- </div>
-
- <div id="content">
-<!-- ============================== class title ============================ -->
- <h1 class="classTitle">
- {!
- var classType = "";
-
- if (data.isBuiltin()) {
- classType += "Built-In ";
- }
-
- if (data.isNamespace) {
- if (data.is('FUNCTION')) {
- classType += "Function ";
- }
- classType += "Namespace ";
- }
- else {
- classType += "Class ";
- }
- !}
- {+classType+}{+data.alias+}
- </h1>
-
-<!-- ============================== class summary ========================== -->
- <p class="description">
- <if test="data.augments.length"><br />Extends
- {+
- data.augments
- .sort()
- .map(
- function($) { return new Link().toSymbol($); }
- )
- .join(", ")
- +}.<br />
- </if>
-
- {+resolveLinks(data.classDesc)+}
-
- <if test="!data.isBuiltin()">{# isn't defined in any file #}
- <br /><i>Defined in: </i> {+new Link().toSrc(data.srcFile)+}.
- </if>
- </p>
-
-<!-- ============================== constructor summary ==================== -->
- <if test="!data.isBuiltin() && (data.isNamespace || data.is('CONSTRUCTOR'))">
- <table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class {+data.alias+}.">
- <caption>{+classType+}Summary</caption>
- <thead>
- <tr>
- <th scope="col">Constructor Attributes</th>
- <th scope="col">Constructor Name and Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="attributes">{!
- if (data.isPrivate) output += "&lt;private&gt; ";
- if (data.isInner) output += "&lt;inner&gt; ";
- !}&nbsp;</td>
- <td class="nameDescription" {!if (data.comment.getTag("hilited").length){output += 'style="color: red"'}!}>
- <div class="fixedFont">
- <b>{+ new Link().toSymbol(data.alias).inner('constructor')+}</b><if test="classType != 'Namespace '">{+ makeSignature(data.params) +}</if>
- </div>
- <div class="description">{+resolveLinks(summarize(data.desc))+}</div>
- </td>
- </tr>
- </tbody>
- </table>
- </if>
-
-<!-- ============================== properties summary ===================== -->
- <if test="data.properties.length">
- {! var ownProperties = data.properties.filter(function($){return $.memberOf == data.alias && !$.isNamespace}).sort(makeSortby("name")); !}
- <if test="ownProperties.length">
- <table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class {+data.alias+}.">
- <caption>Field Summary</caption>
- <thead>
- <tr>
- <th scope="col">Field Attributes</th>
- <th scope="col">Field Name and Description</th>
- </tr>
- </thead>
- <tbody>
- <for each="member" in="ownProperties">
- <tr>
- <td class="attributes">{!
- if (member.isPrivate) output += "&lt;private&gt; ";
- if (member.isInner) output += "&lt;inner&gt; ";
- if (member.isStatic) output += "&lt;static&gt; ";
- if (member.isConstant) output += "&lt;constant&gt; ";
- !}&nbsp;</td>
- <td class="nameDescription">
- <div class="fixedFont">
- <if test="member.isStatic && member.memberOf != '_global_'">{+member.memberOf+}.</if><b>{+new Link().toSymbol(member.alias).withText(member.name)+}</b>
- </div>
- <div class="description">{+resolveLinks(summarize(member.desc))+}</div>
- </td>
- </tr>
- </for>
- </tbody>
- </table>
- </if>
-
- <if test="data.inheritsFrom.length">
- <dl class="inheritsList">
- {!
- var borrowedMembers = data.properties.filter(function($) {return $.memberOf != data.alias});
-
- var contributers = [];
- borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)});
- for (var i = 0, l = contributers.length; i < l; i++) {
- output +=
- "<dt>Fields borrowed from class "+new Link().toSymbol(contributers[i])+": </dt>"
- +
- "<dd>" +
- borrowedMembers
- .filter(
- function($) { return $.memberOf == contributers[i] }
- )
- .sort(makeSortby("name"))
- .map(
- function($) { return new Link().toSymbol($.alias).withText($.name) }
- )
- .join(", ")
- +
- "</dd>";
- }
- !}
- </dl>
- </if>
- </if>
-
-<!-- ============================== methods summary ======================== -->
- <if test="data.methods.length">
- {! var ownMethods = data.methods.filter(function($){return $.memberOf == data.alias && !$.isNamespace}).sort(makeSortby("name")); !}
- <if test="ownMethods.length">
- <table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class {+data.alias+}.">
- <caption>Method Summary</caption>
- <thead>
- <tr>
- <th scope="col">Method Attributes</th>
- <th scope="col">Method Name and Description</th>
- </tr>
- </thead>
- <tbody>
- <for each="member" in="ownMethods">
- <tr>
- <td class="attributes">{!
- if (member.isPrivate) output += "&lt;private&gt; ";
- if (member.isInner) output += "&lt;inner&gt; ";
- if (member.isStatic) output += "&lt;static&gt; ";
- !}&nbsp;</td>
- <td class="nameDescription">
- <div class="fixedFont"><if test="member.isStatic && member.memberOf != '_global_'">{+member.memberOf+}.</if><b>{+new Link().toSymbol(member.alias).withText(member.name)+}</b>{+makeSignature(member.params)+}
- </div>
- <div class="description">{+resolveLinks(summarize(member.desc))+}</div>
- </td>
- </tr>
- </for>
- </tbody>
- </table>
- </if>
-
- <if test="data.inheritsFrom.length">
- <dl class="inheritsList">
- {!
- var borrowedMembers = data.methods.filter(function($) {return $.memberOf != data.alias});
- var contributers = [];
- borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)});
- for (var i = 0, l = contributers.length; i < l; i++) {
- output +=
- "<dt>Methods borrowed from class "+new Link().toSymbol(contributers[i])+": </dt>"
- +
- "<dd>" +
- borrowedMembers
- .filter(
- function($) { return $.memberOf == contributers[i] }
- )
- .sort(makeSortby("name"))
- .map(
- function($) { return new Link().toSymbol($.alias).withText($.name) }
- )
- .join(", ")
- +
- "</dd>";
- }
-
- !}
- </dl>
- </if>
- </if>
-<!-- ============================== events summary ======================== -->
- <if test="data.events.length">
- {! var ownEvents = data.events.filter(function($){return $.memberOf == data.alias && !$.isNamespace}).sort(makeSortby("name")); !}
- <if test="ownEvents.length">
- <table class="summaryTable" cellspacing="0" summary="A summary of the events documented in the class {+data.alias+}.">
- <caption>Event Summary</caption>
- <thead>
- <tr>
- <th scope="col">Event Attributes</th>
- <th scope="col">Event Name and Description</th>
- </tr>
- </thead>
- <tbody>
- <for each="member" in="ownEvents">
- <tr>
- <td class="attributes">{!
- if (member.isPrivate) output += "&lt;private&gt; ";
- if (member.isInner) output += "&lt;inner&gt; ";
- if (member.isStatic) output += "&lt;static&gt; ";
- !}&nbsp;</td>
- <td class="nameDescription">
- <div class="fixedFont"><if test="member.isStatic && member.memberOf != '_global_'">{+member.memberOf+}.</if><b>{+new Link().toSymbol(member.alias).withText(member.name)+}</b>{+makeSignature(member.params)+}
- </div>
- <div class="description">{+resolveLinks(summarize(member.desc))+}</div>
- </td>
- </tr>
- </for>
- </tbody>
- </table>
- </if>
-
- <if test="data.inheritsFrom.length">
- <dl class="inheritsList">
- {!
- var borrowedMembers = data.events.filter(function($) {return $.memberOf != data.alias});
- var contributers = [];
- borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)});
- for (var i = 0, l = contributers.length; i < l; i++) {
- output +=
- "<dt>Events borrowed from class "+new Link().toSymbol(contributers[i])+": </dt>"
- +
- "<dd>" +
- borrowedMembers
- .filter(
- function($) { return $.memberOf == contributers[i] }
- )
- .sort(makeSortby("name"))
- .map(
- function($) { return new Link().toSymbol($.alias).withText($.name) }
- )
- .join(", ")
- +
- "</dd>";
- }
-
- !}
- </dl>
- </if>
- </if>
-
-<!-- ============================== constructor details ==================== -->
- <if test="!data.isBuiltin() && (data.isNamespace || data.is('CONSTRUCTOR'))">
- <div class="details"><a name="constructor"> </a>
- <div class="sectionTitle">
- {+classType+}Detail
- </div>
-
- <div class="fixedFont">{!
- if (data.isPrivate) output += "&lt;private&gt; ";
- if (data.isInner) output += "&lt;inner&gt; ";
- !}
- <b>{+ data.alias +}</b><if test="classType != 'Namespace '">{+ makeSignature(data.params) +}</if>
- </div>
-
- <div class="description">
- {+resolveLinks(data.desc)+}
- <if test="data.author"><br /><i>Author: </i>{+data.author+}.</if>
- </div>
-
- <if test="data.example.length">
- <for each="example" in="data.example">
- <pre class="code">{+example+}</pre>
- </for>
- </if>
-
-
- <if test="data.params.length">
- <dl class="detailList">
- <dt class="heading">Parameters:</dt>
- <for each="item" in="data.params">
- <dt>
- {+((item.type)?""+("<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type)+"}</span> ")) : "")+} <b>{+item.name+}</b>
- <if test="item.isOptional"><i>Optional<if test="item.defaultValue">, Default: {+item.defaultValue+}</if></i></if>
- </dt>
- <dd>{+resolveLinks(item.desc)+}</dd>
- </for>
- </dl>
- </if>
- <if test="data.deprecated">
- <dl class="detailList">
- <dt class="heading">Deprecated:</dt>
- <dt>
- {+resolveLinks(data.deprecated)+}
- </dt>
- </dl>
- </if>
- <if test="data.since">
- <dl class="detailList">
- <dt class="heading">Since:</dt>
- <dd>{+ data.since +}</dd>
- </dl>
- </if>
- <if test="data.exceptions.length">
- <dl class="detailList">
- <dt class="heading">Throws:</dt>
- <for each="item" in="data.exceptions">
- <dt>
- {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
- </dt>
- <dd>{+resolveLinks(item.desc)+}</dd>
- </for>
- </dl>
- </if>
- <if test="data.returns.length">
- <dl class="detailList">
- <dt class="heading">Returns:</dt>
- <for each="item" in="data.returns">
- <dd>{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}{+resolveLinks(item.desc)+}</dd>
- </for>
- </dl>
- </if>
- <if test="data.requires.length">
- <dl class="detailList">
- <dt class="heading">Requires:</dt>
- <for each="item" in="data.requires">
- <dd>{+ resolveLinks(item) +}</dd>
- </for>
- </dl>
- </if>
- <if test="data.see.length">
- <dl class="detailList">
- <dt class="heading">See:</dt>
- <for each="item" in="data.see">
- <dd>{+ new Link().toSymbol(item) +}</dd>
- </for>
- </dl>
- </if>
-
- </div>
- </if>
-
-<!-- ============================== field details ========================== -->
- <if test="defined(ownProperties) && ownProperties.length">
- <div class="sectionTitle">
- Field Detail
- </div>
- <for each="member" in="ownProperties">
- <a name="{+Link.symbolNameToLinkName(member)+}"> </a>
- <div class="fixedFont">{!
- if (member.isPrivate) output += "&lt;private&gt; ";
- if (member.isInner) output += "&lt;inner&gt; ";
- if (member.isStatic) output += "&lt;static&gt; ";
- if (member.isConstant) output += "&lt;constant&gt; ";
- !}
-
- <if test="member.type"><span class="light">{{+new Link().toSymbol(member.type)+}}</span></if>
- <if test="member.isStatic && member.memberOf != '_global_'"><span class="light">{+member.memberOf+}.</span></if><b>{+member.name+}</b>
-
- </div>
- <div class="description">
- {+resolveLinks(member.desc)+}
- <if test="member.srcFile != data.srcFile">
- <br />
- <i>Defined in: </i> {+new Link().toSrc(member.srcFile)+}.
- </if>
- <if test="member.author"><br /><i>Author: </i>{+member.author+}.</if>
- </div>
-
- <if test="member.example.length">
- <for each="example" in="member.example">
- <pre class="code">{+example+}</pre>
- </for>
- </if>
-
- <if test="member.deprecated">
- <dl class="detailList">
- <dt class="heading">Deprecated:</dt>
- <dt>
- {+ member.deprecated +}
- </dt>
- </dl>
- </if>
- <if test="member.since">
- <dl class="detailList">
- <dt class="heading">Since:</dt>
- <dd>{+ member.since +}</dd>
- </dl>
- </if>
- <if test="member.see.length">
- <dl class="detailList">
- <dt class="heading">See:</dt>
- <for each="item" in="member.see">
- <dd>{+ new Link().toSymbol(item) +}</dd>
- </for>
- </dl>
- </if>
- <if test="member.defaultValue">
- <dl class="detailList">
- <dt class="heading">Default Value:</dt>
- <dd>
- {+resolveLinks(member.defaultValue)+}
- </dd>
- </dl>
- </if>
-
- <if test="!$member_last"><hr /></if>
- </for>
- </if>
-
-<!-- ============================== method details ========================= -->
- <if test="defined(ownMethods) && ownMethods.length">
- <div class="sectionTitle">
- Method Detail
- </div>
- <for each="member" in="ownMethods">
- <a name="{+Link.symbolNameToLinkName(member)+}"> </a>
- <div class="fixedFont">{!
- if (member.isPrivate) output += "&lt;private&gt; ";
- if (member.isInner) output += "&lt;inner&gt; ";
- if (member.isStatic) output += "&lt;static&gt; ";
- !}
-
- <if test="member.type"><span class="light">{{+new Link().toSymbol(member.type)+}}</span></if>
- <if test="member.isStatic && member.memberOf != '_global_'"><span class="light">{+member.memberOf+}.</span></if><b>{+member.name+}</b>{+makeSignature(member.params)+}
-
- </div>
- <div class="description">
- {+resolveLinks(member.desc)+}
- <if test="member.srcFile != data.srcFile">
- <br />
- <i>Defined in: </i> {+new Link().toSrc(member.srcFile)+}.
- </if>
- <if test="member.author"><br /><i>Author: </i>{+member.author+}.</if>
- </div>
-
- <if test="member.example.length">
- <for each="example" in="member.example">
- <pre class="code">{+example+}</pre>
- </for>
- </if>
-
- <if test="member.params.length">
- <dl class="detailList">
- <dt class="heading">Parameters:</dt>
- <for each="item" in="member.params">
- <dt>
- {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}<b>{+item.name+}</b>
- <if test="item.isOptional"><i>Optional<if test="item.defaultValue">, Default: {+item.defaultValue+}</if></i></if>
- </dt>
- <dd>{+resolveLinks(item.desc)+}</dd>
- </for>
- </dl>
- </if>
- <if test="member.deprecated">
- <dl class="detailList">
- <dt class="heading">Deprecated:</dt>
- <dt>
- {+member.deprecated+}
- </dt>
- </dl>
- </if>
- <if test="member.since">
- <dl class="detailList">
- <dt class="heading">Since:</dt>
- <dd>{+ member.since +}</dd>
- </dl>
- </dl>
- </if>
- <if test="member.exceptions.length">
- <dl class="detailList">
- <dt class="heading">Throws:</dt>
- <for each="item" in="member.exceptions">
- <dt>
- {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
- </dt>
- <dd>{+resolveLinks(item.desc)+}</dd>
- </for>
- </dl>
- </if>
- <if test="member.returns.length">
- <dl class="detailList">
- <dt class="heading">Returns:</dt>
- <for each="item" in="member.returns">
- <dd>{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}{+resolveLinks(item.desc)+}</dd>
- </for>
- </dl>
- </if>
- <if test="member.requires.length">
- <dl class="detailList">
- <dt class="heading">Requires:</dt>
- <for each="item" in="member.requires">
- <dd>{+ resolveLinks(item) +}</dd>
- </for>
- </dl>
- </if>
- <if test="member.see.length">
- <dl class="detailList">
- <dt class="heading">See:</dt>
- <for each="item" in="member.see">
- <dd>{+ new Link().toSymbol(item) +}</dd>
- </for>
- </dl>
- </if>
-
- <if test="!$member_last"><hr /></if>
- </for>
- </if>
-
-<!-- ============================== event details ========================= -->
- <if test="defined(ownEvents) && ownEvents.length">
- <div class="sectionTitle">
- Event Detail
- </div>
- <for each="member" in="ownEvents">
- <a name="event:{+Link.symbolNameToLinkName(member)+}"> </a>
- <div class="fixedFont">{!
- if (member.isPrivate) output += "&lt;private&gt; ";
- if (member.isInner) output += "&lt;inner&gt; ";
- if (member.isStatic) output += "&lt;static&gt; ";
- !}
-
- <if test="member.type"><span class="light">{{+new Link().toSymbol(member.type)+}}</span></if>
- <if test="member.isStatic && member.memberOf != '_global_'"><span class="light">{+member.memberOf+}.</span></if><b>{+member.name+}</b>{+makeSignature(member.params)+}
-
- </div>
- <div class="description">
- {+resolveLinks(member.desc)+}
- <if test="member.srcFile != data.srcFile">
- <br />
- <i>Defined in: </i> {+new Link().toSrc(member.srcFile)+}.
- </if>
- <if test="member.author"><br /><i>Author: </i>{+member.author+}.</if>
- </div>
-
- <if test="member.example.length">
- <for each="example" in="member.example">
- <pre class="code">{+example+}</pre>
- </for>
- </if>
-
- <if test="member.params.length">
- <dl class="detailList">
- <dt class="heading">Parameters:</dt>
- <for each="item" in="member.params">
- <dt>
- {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}<b>{+item.name+}</b>
- <if test="item.isOptional"><i>Optional<if test="item.defaultValue">, Default: {+item.defaultValue+}</if></i></if>
- </dt>
- <dd>{+resolveLinks(item.desc)+}</dd>
- </for>
- </dl>
- </if>
- <if test="member.deprecated">
- <dl class="detailList">
- <dt class="heading">Deprecated:</dt>
- <dt>
- {+member.deprecated+}
- </dt>
- </dl>
- </if>
- <if test="member.since">
- <dl class="detailList">
- <dt class="heading">Since:</dt>
- <dd>{+ member.since +}</dd>
- </dl>
- </dl>
- </if>
- <if test="member.exceptions.length">
- <dl class="detailList">
- <dt class="heading">Throws:</dt>
- <for each="item" in="member.exceptions">
- <dt>
- {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
- </dt>
- <dd>{+resolveLinks(item.desc)+}</dd>
- </for>
- </dl>
- </if>
- <if test="member.returns.length">
- <dl class="detailList">
- <dt class="heading">Returns:</dt>
- <for each="item" in="member.returns">
- <dd>{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}{+resolveLinks(item.desc)+}</dd>
- </for>
- </dl>
- </if>
- <if test="member.requires.length">
- <dl class="detailList">
- <dt class="heading">Requires:</dt>
- <for each="item" in="member.requires">
- <dd>{+ resolveLinks(item) +}</dd>
- </for>
- </dl>
- </if>
- <if test="member.see.length">
- <dl class="detailList">
- <dt class="heading">See:</dt>
- <for each="item" in="member.see">
- <dd>{+ new Link().toSymbol(item) +}</dd>
- </for>
- </dl>
- </if>
-
- <if test="!$member_last"><hr /></if>
- </for>
- </if>
-
- <hr />
- </div>
-
-
-<!-- ============================== footer ================================= -->
- <div class="fineprint" style="clear:both">
- <if test="JSDOC.opt.D.copyright">&copy;{+JSDOC.opt.D.copyright+}<br /></if>
- Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> {+JSDOC.VERSION+} on {+new Date()+}
- </div>
- </body>
-</html>
39 vendor/jasmine/jsdoc-template/index.tmpl
View
@@ -1,39 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}"" />
-
- <title>JsDoc Reference - Index</title>
- <meta name="generator" content="JsDoc Toolkit" />
-
- <style type="text/css">
- {+include("static/default.css")+}
- </style>
- </head>
-
- <body>
- {+include("static/header.html")+}
-
- <div id="index">
- {+publish.classesIndex+}
- </div>