Compare commits

...

183 Commits

Author SHA1 Message Date
John Bintz 825a9a1278 leftover file removed 2011-06-07 10:10:54 -04:00
John Bintz 793470b65f suites also support descriptions from classnames 2011-06-07 10:01:48 -04:00
John Bintz 222dda4e06 if a spec description is given a function as the description, use its name as the displayed description 2011-06-07 09:50:05 -04:00
Davis W. Frank af7f1818b0 Revert back to the old jasmine.css 2011-06-05 21:55:51 -07:00
Davis W. Frank 12f56787b0 Move building single-file JS to use a JSON file with initial priority files 2011-06-05 21:55:32 -07:00
Davis W. Frank e88d88e427 Move all core files into src/core.
Move Browser & Node specs to test against lib/jasmine.js instead of the separate source. Yes, this makes development a little harder but it's better to test that jasmine.js was built correctly.
2011-06-05 21:28:26 -07:00
Davis W. Frank ba10d178b2 Better stack trace on exception. Better results if exception is due to true exception 2011-06-01 21:14:59 -07:00
Davis W. Frank da297d0f56 And what I meant was *this* commit was pulling in the fixes to TrivialConsoleReporter 2011-05-25 08:28:16 -07:00
Davis W. Frank 7ead5388c2 merge in fixes to TrivialConsoleReporter: correct # of specs, no longer limited by column length 2011-05-25 08:14:18 -07:00
Davis W. Frank a445a62e7c TrivialConsoleReporter now reports the correct number of specs that were executed. TCR is still very heavily mocked instead of using testing an actual Jasmine environment. But now at least the numbers are correct. 2011-05-16 18:28:46 -07:00
Davis W. Frank 1d65d56a92 TrivialConsoleReporter refactor & fixes. No longer limitied to 50 columns of dots. 2011-05-16 08:08:12 -07:00
ragaskar d875d1d997 Don't run TrivialConsoleReporter specs if TrivialConsoleReporter is not loaded 2011-05-06 23:18:57 -04:00
ragaskar 1fae8f0a31 Rebuild main jasmine lib 2011-05-06 23:08:49 -04:00
ragaskar c1f8151bcb Add png suitable for favicon 2011-05-06 22:40:53 -04:00
ragaskar bd8a3baed1 Remove unused image files 2011-05-06 22:30:48 -04:00
ragaskar 118324b451 Don't show 'Jasmine waiting for...' console messages unless jasmine.VERBOSE is set to true 2011-05-06 19:07:00 -04:00
ragaskar c30f7d1aa7 Fail with an error if node is not installed when running rake spec 2011-05-06 18:34:42 -04:00
ragaskar de7be4b316 ignore rvmrc 2011-05-06 18:32:58 -04:00
Davis W. Frank b02aa9840a fixed bad merge of gvanhove's describe exception fix 2011-04-17 21:44:41 -07:00
Davis W. Frank 61de2268fe toBeCloseTo matcher merged in 2011-04-17 21:18:41 -07:00
gvanhove dd32048383 Failure messages for toHaveBeenCalledWith print out the name of the spy 2011-04-17 20:55:32 -07:00
gvanhove 32e736aa47 commit updated version into jasmine.js 2011-04-17 20:55:32 -07:00
Steve Conover 38e9af8f68 integrating TrivialConsoleReporter into node_suite.js, deleting some code pulled over from jasmine-node 2011-04-17 20:50:57 -07:00
Carl Jackson & Davis W. Frank e826fbb170 More README edits for the Contributor guide 2011-03-09 13:31:03 -08:00
Carl Jackson & Davis W. Frank 0c77662c5b One more README tweak 2011-03-09 13:15:33 -08:00
Davis W. Frank 75fb19bc49 README changes 2011-03-09 08:16:47 -08:00
Davis W. Frank 6ec825f62d Updating docs. Version goes to 1.1.0 2011-03-08 18:39:13 -08:00
Davis W. Frank fc994108db Update Rakefile a bit. Added more rake tasks to run specs. 2011-03-08 18:38:46 -08:00
Davis W. Frank 70aed2d900 move all "assertion" to "expectation" 2011-03-08 18:37:44 -08:00
Davis W. Frank ccfa17499f Merge remote branch 'sconover/trivial_console_reporter' into work 2011-03-07 22:35:25 -08:00
Davis W. Frank ab087ef5f8 Pendantic terminology 2011-03-07 22:34:58 -08:00
Davis W. Frank 0ef6582f73 Merging in sconover/jshint 2011-03-07 22:30:43 -08:00
Steve Conover a1ba43c864 call back when done 2011-02-28 23:58:06 -08:00
Steve Conover 88ee377662 integrated trivial console into a real-world situation and dicovered a couple mistakes/misses 2011-02-28 23:18:53 -08:00
Steve Conover f5afe18a6b semicolon fixes subsequent to jshint run 2011-02-28 22:56:04 -08:00
Steve Conover 2731716ccb making this consistent 2011-02-28 22:39:16 -08:00
Steve Conover 4e5083d570 style rf 2011-02-28 22:36:31 -08:00
Steve Conover b9cbd3c5a0 integration test - failure scenario 2011-02-28 22:30:03 -08:00
Steve Conover e42026ee84 rename *node to *console 2011-02-28 21:15:57 -08:00
Steve Conover a1f58f8be4 rf 2011-02-28 21:15:57 -08:00
Steve Conover ac00d765d2 integration tests - passing scenarios 2011-02-28 21:15:57 -08:00
Steve Conover b1dceeacd4 stack traces 2011-02-28 21:15:57 -08:00
Steve Conover 5018f0d1c2 spec failure - description 2011-02-28 21:15:57 -08:00
Steve Conover 9704550b33 rf 2011-02-28 21:15:56 -08:00
Steve Conover 882c287191 specs/assertions/failures 2011-02-28 21:15:56 -08:00
Steve Conover 7d2b900b48 remember suite results as suites finish 2011-02-28 21:15:56 -08:00
Steve Conover f701fdc132 needful 2011-02-28 21:15:56 -08:00
Steve Conover eb49fab652 print elapsed time in summary 2011-02-28 21:15:56 -08:00
Steve Conover e8c8a0bdfd run result - passed green, failed red 2011-02-28 21:15:56 -08:00
Steve Conover e6a080039f print started when the test run starts 2011-02-28 21:15:56 -08:00
Steve Conover c485c33a3c skipped specs mean yellow star 2011-02-28 21:15:56 -08:00
Steve Conover 8fbf3ba859 newline at 50 characters 2011-02-28 21:15:56 -08:00
Steve Conover dccafe33b0 style reform 2011-02-28 21:15:56 -08:00
Steve Conover c1d2718bea red F, duh 2011-02-28 21:15:55 -08:00
Steve Conover 945a9ba638 failing spec makes a red dot 2011-02-28 21:15:55 -08:00
Steve Conover 528b5abeda beginning of trivial node reporter, based on jasmine-node. jshint rules exclude bad escapements WRT ansi colors, beacuse that's ok. 2011-02-28 21:15:55 -08:00
Davis W. Frank d7cced2e7c How to for release 2011-02-27 14:22:53 -08:00
Davis W. Frank 3be0610572 adding latest pages 2011-02-27 14:00:45 -08:00
Davis W. Frank 5e90115eaf removing incorrectlt added submodule 2011-02-27 12:33:47 -08:00
Davis W. Frank 148317eb90 1.0.2, finishing to Frank for static pages 2011-02-27 12:26:38 -08:00
Davis W. Frank 45b4e1316c updating for new pages 2011-02-27 10:36:13 -08:00
Davis W. Frank aee4c5926c .gitmodules 2011-02-27 09:48:17 -08:00
Steve Conover f41af6c2d0 jshint passes - run 'node jshint/run.js'. running jshint with a couple jshint options and workarounds to allow certain jasmine-specific styles. many actual style problems are fixed. the jshint run is integrated into rake jasmine:lint. 2011-02-26 15:07:59 -08:00
Steve Conover 9f90c4eca5 initial jshint commit. including the library, made a runner for jasmine. 2011-02-26 11:23:25 -08:00
Steve Conover 545752ae20 semicolons 2011-02-26 11:01:33 -08:00
Steve Conover c04f1b1fa8 node spec/node_suite.js runs all dom-independent jasmine specs. basic commonjs support for jasmine along the way. node_suite.js and runner.html are both green. 2011-02-26 10:53:55 -08:00
Davis W. Frank fa9741dbda removed old ghpages dir 2011-02-25 08:14:48 -08:00
Davis W. Frank 560cb2edcb wip 2011-02-25 08:10:34 -08:00
Davis W. Frank 9a12b32a3a swapping ignore from Jekyll to staticmatic 2011-01-25 13:23:01 -08:00
Christian Williams bd15ed6a45 Really? "File.exist?", not "File.exists?"? Whatever. 2010-11-09 13:10:40 -05:00
Christian Williams fa74051071 Don't commit Gemfile.lock. 2010-11-09 09:48:30 -05:00
Christian Williams 127fe049d9 Build for 1.0.1. 2010-10-05 13:51:29 -07:00
Christian Williams 550e378dc0 Fix download page regen after redesign. 2010-10-05 13:50:55 -07:00
Christian Williams 377703745f Making the checkboxes work fine on IE. onchange doesnt work very well with checkboxes there. The target is not set too.
Original author: Fabio M. Costa <fabiomcosta@gmail.com>
2010-10-05 13:27:50 -07:00
Fabio M. Costa 8ecfd26325 Making the checkboxes work fine on IE. onchange doesnt work very well with checkboxes there. The target is not set too. 2010-10-05 13:25:24 -07:00
Christian Williams 2d10cc1404 IE doesn't have console.log.apply(); fall back to console.log() in that case. 2010-10-05 13:11:27 -07:00
Christian Williams & Ryan Richard 63df354e78 Drop in jsdoc template (from jsdoc-toolkit 2.1.0). 2010-10-05 13:11:04 -07:00
Christian Williams c8d9fc562f Un-hide release notes for 1.0.
Shade prerelease standalone versions in download list.
2010-09-14 13:42:38 -07:00
Christian Williams 1530ad25f9 Regenerate index.html with standalone download link. 2010-09-14 13:01:42 -07:00
Christian Williams b2557e4ebe Build dist for 1.0.0. 2010-09-14 12:58:02 -07:00
Christian Williams 85c265e7c5 Bump version to 1.0.0! 2010-09-14 12:54:23 -07:00
Christian Williams cc36a1808b Add link to jasmine site from html runner. 2010-09-12 13:11:33 -07:00
Christian Williams 685344342a Add MIT.LICENSE to standalone zip. 2010-09-08 13:38:55 -07:00
Christian Williams a4eab045a0 Fix version format -- 1.0.0.rc1 instead of 1.0.0RC1, and include in standalone zip. 2010-08-26 13:15:15 -07:00
Christian Williams cd0346b449 Allow version parts to have non-numeric components (e.g. "rc1"). 2010-08-26 13:11:54 -07:00
Christian Williams f134c6e386 Regenerate download page. 2010-08-25 18:44:27 -07:00
Christian Williams 75238bd3b1 Update version to 1.0.0 for RC1. 2010-08-25 18:25:52 -07:00
Christian Williams b8b4457b6b Regenerate jasmine.js. 2010-08-25 18:18:49 -07:00
Christian Williams b33b2d2cf1 toThrow()'s (and some other matchers') .not message is misleading. 2010-08-25 18:16:37 -07:00
Christian Williams 3ec736f64c Regenerate jasmine.js. 2010-08-25 18:07:14 -07:00
Christian Williams e7a57606a2 Allow waitsFor() arguments to be specified in arbitrary order.
Default waitsFor() timeout is now specified in env.defaultTimeoutInterval; defaults to 5 seconds.
Deprecate waits() block in favor of waitsFor().
2010-08-25 18:04:52 -07:00
Christian Williams 55149310c3 Fixed bug: waitsFor() hangs forever if latch function never returns true. 2010-08-25 17:16:19 -07:00
Christian Williams 254ebb8a03 Update jasmine.js. 2010-08-25 15:46:57 -07:00
Christian Williams 762f88e3c8 Some exploration and refactoring re waitsFor() bug: waitsFor() hangs forever if latch function never returns true. 2010-08-19 23:55:21 -07:00
Christian Williams b3715075e3 Add custom messages for inverted spy matchers. 2010-08-13 00:32:32 -07:00
Christian Williams 9af81b627b Missing semicolons. 2010-08-05 23:10:09 -07:00
Christian Williams 5d44da0238 Remove acknowledgements and analytics code from README. 2010-08-05 00:54:54 -07:00
Christian Williams 93952890c3 Deprecate toNotBe, toNotEqual, toNotMatch, and toNotContain matchers. 2010-08-05 00:50:59 -07:00
Christian Williams 5182e00c66 Wrapped matcher functions return undefined after expect() for futureproofing; we might want to allow matcher chaining, e.g.:
expect(x).toBeGreaterThan(3).and.toBeLessThan(6));
or other stuff e.g.:
  expect(x).toBeTrue().because("it just needs to be");
2010-08-04 13:52:38 -07:00
Christian Williams 676af93bea Refactor toThrow() matcher specs. 2010-08-03 18:51:31 -07:00
Christian Williams 4d7b839473 Fix not.toThrow() matcher exception when used with no args. 2010-08-02 18:36:26 -07:00
Todd Persen 89afebd86b Update copyright years. 2010-07-30 11:59:30 -04:00
Christian Williams 31020bb51d Try adding analytics code. 2010-07-28 18:18:18 -07:00
Christian Williams 17e9a038a2 2010-07-28 18:17:10 -07:00
Todd Persen 1e01000c17 Update MIT License and add to README. 2010-07-28 11:20:29 -04:00
Christian Williams 6562b5a3b4 Add warning to SpecRunner.html when running from non-built source. 2010-07-27 18:47:12 -07:00
Christian Williams & Jay Phillips 15955df258 Styling. 2010-07-23 18:25:21 -07:00
Christian Williams & Jay Phillips 81bf4784cd Move User Guide to site. 2010-07-23 18:23:53 -07:00
Christian Williams & Jay Phillips 14486f5912 Add jekyll to Gemfile. 2010-07-23 18:19:16 -07:00
Christian Williams & Jay Phillips 9842c8ff81 Move User Guide from github README to here. 2010-07-23 18:08:33 -07:00
Christian Williams feb4618c31 Add Gemfile. 2010-07-23 10:06:19 -07:00
Christian Williams & Jay Phillips c6acfb3982 Merge branch 'master', remote branch 'origin' 2010-07-21 18:55:55 -07:00
Tom Crayford ba5bd3f866 Jasmine.createSpy() throws a reference error, jasmine.createSpy() does not. 2010-07-18 00:45:23 +08:00
Christian Williams & Harry Ugol 0331209413 Merge branch 'master' of git://github.com/pivotal/jasmine 2010-07-09 14:51:13 -07:00
Christian Williams 57491a0088 README updates. 2010-07-05 22:56:37 -07:00
Christian Williams e6b6d9ca95 2010-07-05 22:46:55 -07:00
Christian Williams bf44d4b0db Change link to downloads. 2010-07-01 00:06:28 -07:00
Christian Williams 3da73bd519 Remove unused lib/consolex.js. 2010-06-30 23:49:34 -07:00
Christian Williams 61c0fe781c Styling fix. 2010-06-30 00:09:01 -07:00
Harry Ugol & Tyler Schultz 766f3546bf Add gem reference. 2010-06-28 10:52:22 -07:00
Lee Byrd & Christian Williams f6d1f7d871 checking in master's SHA 2010-06-25 18:19:02 -07:00
Lee Byrd & Christian Williams 5e843e087b updating gh-pages SHA 2010-06-25 18:13:58 -07:00
Lee Byrd & Christian Williams 51c0563608 bumping version to 0.11.1 2010-06-25 18:11:18 -07:00
Lee Byrd & Christian Williams 9e3036fbf7 Doc fix. 2010-06-25 17:40:50 -07:00
Lee Byrd & Christian Williams dcc8b460d1 Rakefile updates pages/index.html. 2010-06-25 17:35:08 -07:00
Lee Byrd & Christian Williams c533b67aa5 Remove vestiges of ruby ci code from jasmine core.
Add missing lib/jasmine-html.js.
2010-06-25 15:16:43 -07:00
Lee Byrd & Christian Williams 7a69d64669 Add dist to .gitignore.
Exclude hidden files from standalone zip.
2010-06-25 10:07:08 -07:00
Lee Byrd & Christian Williams ed80a0cad7 Re-add lib/jasmine.css for jasmine-gem. 2010-06-24 17:37:13 -07:00
Lee Byrd & Christian Williams 85351f2c1c Build html support classes (just TrivialReporter for now) into jasmine-html.js. 2010-06-24 17:33:46 -07:00
Lee Byrd & Christian Williams 1057596665 New example project.
Generate jasmine-standalone-x.x.x.zip.
2010-06-24 17:15:06 -07:00
Lee Byrd & Christian Williams 22065fafad By default don't display "Jasmine Running..." console log for each spec. Re-enable by setting TrivialReporter's logRunningSpecs to true. 2010-06-24 11:10:58 -07:00
Lee Byrd & Christian Williams 2939aff80c deprecating wasCalled, wasCalledWith, wasNotCalled, wasNotCalledWith and adding toHaveBeenCalled, and toHaveBeenCalledWith 2010-06-24 10:34:03 -07:00
Lee Byrd & Christian Williams 6a0e452788 Oops, remove call to jasmine.log(). 2010-06-23 17:12:38 -07:00
Lee Byrd & Christian Williams 00296b02e0 Regenerate jsdoc. 2010-06-23 11:31:55 -07:00
Lee Byrd & Christian Williams 8f5f6a6d27 The single-file lib/jasmine.js no longer has a version number in the filename. We'll make it available for download with the version number seperately.
Add lint check for 'window'.
Remove last 'window' reference.
2010-06-23 11:31:38 -07:00
Lee Byrd & Christian Williams ed47ececa9 The single-file lib/jasmine.js no longer has a version number in the filename. We'll make it available for download with the version number seperately. 2010-06-23 11:26:01 -07:00
Lee Byrd & Christian Williams 9c8180d8d0 Fixed bug where multiple calls to jasmine.Clock.useMock cause multiple tear downs 2010-06-23 11:03:05 -07:00
Lee Byrd & Christian Williams 6a9f74e849 Add jsdoc for jasmine.log. 2010-06-23 10:53:10 -07:00
Lee Byrd & Christian Williams 3be2455d8c README change. 2010-06-23 10:28:02 -07:00
Lee Byrd & Christian Williams 40b0c49d25 Point example_runner.html to latest jasmine version.
Update README.
2010-06-23 10:21:21 -07:00
Lee Byrd & Christian Williams 82e04c327a Bumped version to 0.11.0.
Regenerated docs and lib.
2010-06-22 17:52:25 -07:00
Lee Byrd & Christian Williams 2a3376d11e Removed deprecated jasmine.include().
Removed deprecated ExpectationResult.details.
Removed deprecated Spec.getResults().
2010-06-22 17:38:15 -07:00
Lee Byrd & Christian Williams 413be6b4ca Remove deprecated class jasmine.Reporters.
Fully deprecate old-style Matchers; will be removed in next major version.
2010-06-22 17:35:41 -07:00
Lee Byrd & Christian Williams 0539251fe6 Refactored TrivialReporter to handle duplicate suite names properly 2010-06-22 17:25:08 -07:00
Lee Byrd & Christian Williams 1154fcaf3b Refactor. 2010-06-22 16:45:35 -07:00
Lee Byrd & Christian Williams 01d842fdfd Removed references to 'window'; using jasmine.getGlobal() instead in order to better support non-browser environments.
Better protection around access to console.
The global object is now pretty-printed as "<global>", not "<window>".
Tests are a little closer to passing in node.js.
2010-06-22 16:22:09 -07:00
Lee Byrd & Christian Williams e60f22a2e5 Changed 'type' field of MessageResult and ExpectationResult to 'log' and 'expect', respectively. 2010-06-22 14:48:47 -07:00
Lee Byrd & Christian Williams e7cd6a473a jasmine.log() and Spec#log() take multiple arguments which are pretty-printed and concatted together.
Log messages are handled correctly in TrivialReporter and JsApiReporter.
2010-06-22 12:23:54 -07:00
Lee Byrd & Christian Williams 3bdc96c00a Re-enable and fix JsApiReporterSpec specs. 2010-06-22 12:04:34 -07:00
Lee Byrd & Christian Williams b9bf42c6b5 Merge branch 'master' of git@github.com:pivotal/jasmine into HEAD 2010-06-22 10:43:48 -07:00
Lee Byrd & Christian Williams 2d138f1cfa Refactor. 2010-06-22 10:30:06 -07:00
Lee Byrd & Christian Williams e30b99e7b3 JsApiReporter reports nested suites correctly.
Runner#topLevelSuites() returns only top level suites.
Suite#specs(), Suite#suites(), and Suite#children() return immediate children.
2010-06-22 10:18:22 -07:00
DanielHeath 40272cd563 Fixed typo in example code. 2010-06-15 11:47:30 +08:00
Pivotal c187adc096 Version bump to 0.10.4 2010-06-05 10:44:54 -04:00
Pivotal 5aa306cf66 Add unit specs for WaitsForBlock 2010-06-05 10:32:41 -04:00
Pivotal 462b50e84e Replace unshift with splice (unshift not IE-safe) 2010-06-05 10:12:16 -04:00
Pivotal 46249bf515 Fix spec failure that occured when stack traces/line numbers are available 2010-06-05 10:07:58 -04:00
Christian Williams 03d7bfb7d4 Oops, shouldn't onComplete there. 2010-06-04 14:48:48 -04:00
Christian Williams 11292ff83c Merge branch 'master' of git@github.com:pivotal/jasmine 2010-06-04 14:45:52 -04:00
Christian Williams ab7678e713 Apply patch from Eric Pabst (May 18, 2010):
Replaced call to self.spec._next() with onComplete() when the test times out.

This is because there is no such function as _next(), and onComplete() seems to
do the right thing.
2010-06-04 14:45:42 -04:00
Eric Pabst 6431431dfc Replaced call to self.spec._next() with onComplete() when the test times out.
This is because there is no such function as _next(), and onComplete() seems to do the right thing.
2010-06-05 02:44:51 +08:00
Christian Williams a2041e90a6 Multiple befores/afters in a single describe should be executed in order (as declared for befores, in reverse for afters). 2010-06-04 14:41:16 -04:00
Christian Williams ed49104fad Jasmine should recover gracefully when there are errors in describe functions. 2010-06-04 14:14:31 -04:00
labday 803a2fb2ba Fixing documentation error. 2010-05-28 05:52:48 +08:00
John Firebaugh bb1928a75c Remove geminstaller stuff.
This isn't a gem anymore, and geminstaller is deprecated.
2010-05-08 10:57:43 +08:00
John Firebaugh 7d5ff6985f Rebuild to fix line endings. 2010-05-08 10:57:43 +08:00
ragaskar 841e93fc09 'Hide' currently unusable Rake tasks 2010-04-20 07:26:51 -07:00
bigfix 5cfb019b6b Documentation and example fixes 2010-04-20 07:26:04 -07:00
Christian Williams & Ian Fisher 9f8d18b6b7 Version bump to 0.10.3 2010-04-01 16:03:52 -07:00
Christian Williams & Ian Fisher f0574086de Version bump to 0.10.3 2010-04-01 16:00:50 -07:00
Christian Williams & Ian Fisher 2212d755c3 Merge commit '5f10b2e623c6c21d1b692bde4a8a5c6d4015cd44' 2010-04-01 15:57:24 -07:00
Christian Williams & Ian Fisher 5f10b2e623 Added Env#versionString; nicer styling in TrivialReporter; hide passed and skipped tests by default, but allow them to be displayed. 2010-04-01 15:56:29 -07:00
Christian Williams d8ed4156c7 Remove contrib/ruby dir. 2010-03-24 14:18:17 -07:00
Christian Williams 1469f83262 Deprecate jasmine.include(). 2010-03-24 13:53:34 -07:00
Christian Williams d6353a3db2 Typo. 2010-03-24 13:43:47 -07:00
ragaskar 9a5b46fd99 Version bump to 0.10.2 2010-03-18 20:35:36 -07:00
ragaskar bf938ffc50 Correct number matching in equals_ 2010-03-18 20:32:40 -07:00
ragaskar c85079e9d0 Handle string comparisons correctly with equals_ 2010-03-17 08:19:29 -07:00
ragaskar dec92322f1 Add default jasmine rake task 2010-03-17 07:54:20 -07:00
Christian Williams 72ea614d5e Rebuild lib/jasmine. 2010-03-15 12:15:50 -07:00
Christian Williams 184ff6fb2d Typo. 2010-03-08 22:03:57 -08:00
Christian Williams 9830952461 Evaluate custom equality testers before any others. 2010-03-08 21:56:04 -08:00
Christian Williams a16cbe7e5b Remove contrib dir. 2009-12-27 11:53:46 -06:00
137 changed files with 11489 additions and 18835 deletions

5
.gitignore vendored
View File

@ -1,2 +1,7 @@
.idea/ .idea/
.svn/ .svn/
.DS_Store
site/
.bundle/
.pairs
.rvmrc

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "pages"]
path = pages
url = git@github.com:pivotal/jasmine.git

6
Gemfile Normal file
View File

@ -0,0 +1,6 @@
source :rubygems
gem "json_pure", "~>1.4.3"
gem "frank"
gem "ragaskar-jsdoc_helper"
gem "rake", "0.8.7"

33
Gemfile.lock Normal file
View File

@ -0,0 +1,33 @@
GEM
remote: http://rubygems.org/
specs:
daemons (1.0.10)
frank (1.0.8)
haml (>= 3.0)
mongrel (>= 1.2.0.pre2)
net-scp (>= 1.0)
net-ssh (>= 2.0)
rack (>= 1.0)
tilt (= 0.9)
gem_plugin (0.2.3)
haml (3.0.25)
json_pure (1.4.6)
mongrel (1.2.0.pre2)
daemons (~> 1.0.10)
gem_plugin (~> 0.2.3)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
net-ssh (2.1.0)
rack (1.2.1)
ragaskar-jsdoc_helper (0.0.2.1)
rake (0.8.7)
tilt (0.9)
PLATFORMS
ruby
DEPENDENCIES
frank
json_pure (~> 1.4.3)
ragaskar-jsdoc_helper
rake (= 0.8.7)

42
HowToRelease.markdown Normal file
View File

@ -0,0 +1,42 @@
## Development
## Release
# Making a Release of Jasmine Core
'Jasmine' is the Github repo for Jasmine Core and contains all the JavaScript code for the Jasmine BDD framework.
It also contains two HTML pages for the Github Pages at http://pivotal.github.com/jasmine.
## The Repo
All of the JS for Jasmine is in the src directory. The specs for each file are in the specs directory. There are rake tasks to build the various files for distribution.
## Running Specs
There are rake tasks to help with getting green:
* `rake spec:browser` opens `spec/runner.html` in the default browser. Please run this in at least Firefox and Chrome before comitting
* `rake spec:node` runs all the Jasmine specs in Node.js
* `rake jasmine:lint` runs all the files through JSHint and will complain about potential viable issues with your code. Fix them.
## The Pages
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_source directory.
## Releasing
Once all specs are green and you've updated the version in `version.json`, you need to run the rake task to make a distribution: `rake jasmine:dist`.

View File

@ -1,4 +1,4 @@
Copyright (c) 2008 Pivotal Labs Copyright (c) 2008-2011 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the

View File

@ -1,502 +1,50 @@
Jasmine <a name="README">[Jasmine](http://pivotal.github.com/jasmine/)</a>
======= =======
**A JavaScript Testing Framework** **A JavaScript Testing Framework**
Quick Start 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.
----------
### Ruby Suite Running Documentation & guides live here: [http://pivotal.github.com/jasmine/](http://pivotal.github.com/jasmine/)
Please use the [jasmine-ruby gem](http://github.com/pivotal/jasmine-ruby) to run suites in a ruby environment.
### HTML Suite Running
[Get the latest release from the downloads page](http://github.com/pivotal/jasmine/downloads)
Open `example/example_runner.html` in your favorite browser.
### Automatic Suite Running (w/ Selenium)
sudo gem sources -a http://gems.github.com
sudo gem install geminstaller
git clone git://github.com/pivotal/jasmine.git
cd jasmine
sudo geminstaller
cd examples/ruby
rake test:ci
Releases
----------
0.10.0 [[download]](http://cloud.github.com/downloads/pivotal/jasmine/jasmine-0.10.0.zip)
0.9.0 [[download]](http://github.com/pivotal/jasmine/zipball/0.9.0)
0.8.0 [[download]](http://github.com/pivotal/jasmine/zipball/0.8.0)
### Which Release Should I Use?
Please use the latest version unless you have a good reason not to. Some of this documentation may not be applicable to older versions.
Pull Requests
----------
We welcome your contributions! Jasmine is currently maintained by Davis Frank ([infews](http://github.com/infews)), Rajan Agaskar ([ragaskar](http://github.com/ragaskar)), and Christian Williams ([Xian](http://github.com/Xian)). You can help us by removing all other recipients from your pull request.
Why Another JavaScript TDD/BDD Framework?
-----------
There are some great JavaScript testing frameworks out there already, so why did we write another?
None of the existing frameworks quite worked the way we wanted. Many only work from within a browser. Most don't support testing asynchronous code like event callbacks. Some have syntax that's hard for JS developers or IDEs to understand.
So we decided to start from scratch.
Enter Jasmine
------------
Jasmine is our dream JavaScript testing framework. It's heavily influenced by, and borrows the best parts of, ScrewUnit, JSSpec, [JSpec](http://github.com/visionmedia/jspec/tree/master), and of course RSpec.
Jasmine was designed with a few principles in mind. We believe that a good JavaScript testing framework:
* should not be tied to any browser, framework, platform, or host language.
* should have idiomatic and unsurprising syntax.
* should work anywhere JavaScript can run, including browsers, servers, phones, etc.
* shouldn't intrude in your application's territory (e.g. by cluttering the global namespace).
* should play well with IDEs (e.g. test code should pass static analysis).
Some of our goals while writing Jasmine:
* it should encourage good testing practices.
* it should integrate easily with continuous build systems.
* it should be simple to get started with.
The result is Jasmine, and we love test-driving our code with it. Enjoy.
How To
------
There is a simple example of how to use Jasmine in the /example directory. But here's more information.
### Specs
Each spec is, naturally, a JavaScript function. You tell Jasmine about this spec with a call to `it()` with a string and the function. The string is a description that will be helpful to you when reading a report.
it('should be a test', function () {
var foo = 0;
foo++;
});
### Expectations
Within your spec you will want to express expectations about the behavior of your application code. These are made with the `expect()` function and expectation matchers, like this:
it('should be a test', function () {
var foo = 0; // set up the world
foo++; // call your application code
expect(foo).toEqual(1); // passes because foo == 1
});
Results of the expectations are logged for later for reporting.
#### Expectation Matchers
Jasmine has several built-in matchers. Here are a few:
>`expect(x).toEqual(y);` compares objects or primitives `x` and `y` and passes if they are equivalent
>
>`expect(x).toMatch(pattern);` compares `x` to string or regular expression `pattern` and passes if they match
>
>`expect(x).toBeDefined();` passes if `x` is not `undefined`
>
>`expect(x).toBeNull();` passes if `x` is not `null`
>
>`expect(x).toBeTruthy();` passes if `x` evaluates to true
>
>`expect(x).toBeFalsy();` passes if `x` evaluates to false
>
>`expect(x).toContain(y);` passes if array or string `x` contains `y`
Every matcher's criteria can be inverted by prepending `.not`:
>`expect(x).not.toEqual(y);` compares objects or primitives `x` and `y` and passes if they are *not* equivalent
#### Writing New Matchers
We've provided a small set of matchers that cover many common situations. However, we recommend that you write custom matchers when you want to assert a more specific sort of expectation. Custom matchers help to document the intent of your specs, and can help to remove code duplication in your specs.
It's extremely easy to create new matchers for your app. A matcher function receives the actual value as `this.actual`, and zero or more arguments may be passed in the function call. The function should return `true` if the actual value passes the matcher's requirements, and `false` if it does not.
Here's the definition of `toBeLessThan()`:
toBeLessThan: function(expected) {
return this.actual < expected;
};
To add the matcher to your suite, call `this.addMatchers()` from within a `before` or `it` block. Call it with an object mapping matcher name to function:
beforeEach(function() {
this.addMatchers({
toBeVisible: function() { return this.actual.isVisible(); }
});
});
### Suites
Specs are grouped in Suites. Suites are defined using the global `describe()` function:
describe('One suite', function () {
it('has a test', function () {
...
});
it('has another test', function () {
...
});
});
The Suite name is so that reporting is more descriptive.
Suites are executed in the order in which `describe()` calls are made, usually in the order in which their script files are included. Additionally, specs within a suite share a functional scope. So you may declare variables inside a describe block and they are accessible from within your specs. For example:
describe('A suite with some variables', function () {
var bar = 0
it('has a test', function () {
bar++;
expect(bar).toEqual(1);
});
it('has another test', function () {
bar++;
expect(bar).toEqual(2);
});
});
#### beforeEach
A suite can have a beforeEach declaration. It takes a function that is run before each spec. For example:
describe('some suite', function () {
var suiteWideFoo;
beforeEach(function () {
suiteWideFoo = 1;
});
it('should equal bar', function () {
expect(suiteWideFoo).toEqual(1);
});
});
A runner can also have beforeEach declarations. Runner beforeEach functions are executed before every spec in all suites, and execute BEFORE suite beforeEach functions. For example:
var runnerWideFoo = [];
beforeEach(function () {
runnerWideFoo.push('runner');
});
describe('some suite', function () {
beforeEach(function () {
runnerWideFoo.push('suite');
});
it('should equal bar', function () {
expect(runnerWideFoo).toEqual(['runner', 'suite']);
});
});
#### afterEach
Similarly, there is an afterEach declaration. It takes a function that is run after each spec. For example:
describe('some suite', function () {
var suiteWideFoo;
afterEach(function () {
suiteWideFoo = 0;
});
it('should equal 1', function () {
expect(suiteWideFoo).toEqual(1);
});
it('should equal 0 after', function () {
expect(suiteWideFoo).toEqual(0);
};
});
A runner can also have an afterEach declarations. Runner afterEach functions are executed after every spec in all suites, and execute AFTER suite afterEach functions. For example:
var runnerWideFoo = [];
afterEach(function () {
runnerWideFoo.push('runner');
});
describe('some suite', function () {
afterEach(function () {
runnerWideFoo.push('suite');
});
it('should be empty', function () {
expect(runnerWideFoo).toEqual([]);
});
it('should be populated after', function () {
expect(runnerWideFoo).toEqual(['suite', 'runner']);
};
});
### Single-spec After functions
A spec may ask Jasmine to execute some code after the spec has finished running; the code will run whether the spec finishes successfully or not. Multiple after functions may be given.
describe('some suite', function () {
it(function () {
var originalTitle = window.title;
this.after(function() { window.title = originalTitle; });
MyWindow.setTitle("new value");
expect(window.title).toEqual("new value");
});
### Nested Describes
Jasmine supports nested describes. An example:
describe('some suite', function () {
var suiteWideFoo;
beforeEach(function () {
suiteWideFoo = 0;
});
describe('some nested suite', function() {
var nestedSuiteBar;
beforeEach(function() {
nestedSuiteBar=1;
});
it('nested expectation', function () {
expect(suiteWideFoo).toEqual(0);
expect(nestedSuiteBar).toEqual(1);
});
});
it('top-level describe', function () {
expect(suiteWideFoo).toEqual(0);
expect(nestedSuiteBar).toEqual(undefined);
});
});
### Spies
Jasmine integrates 'spies' that permit many spying, mocking, and faking behaviors.
Here are a few examples:
var Klass = function () {
};
var Klass.prototype.method = function (arg) {
return arg;
};
var Klass.prototype.methodWithCallback = function (callback) {
return callback('foo');
};
...
it('should spy on Klass#method') {
spyOn(Klass, 'method');
Klass.method('foo argument');
expect(Klass.method).wasCalledWith('foo argument');
});
it('should spy on Klass#methodWithCallback') {
var callback = Jasmine.createSpy();
Klass.method(callback);
expect(callback).wasCalledWith('foo');
});
Spies can be very useful for testing AJAX or other asynchronous behaviors that take callbacks by faking the method firing an async call.
var Klass = function () {
};
var Klass.prototype.asyncMethod = function (callback) {
someAsyncCall(callback);
};
...
it('should test async call') {
spyOn(Klass, 'asyncMethod');
var callback = Jasmine.createSpy();
Klass.asyncMethod(callback);
expect(callback).wasNotCalled();
var someResponseData = 'foo';
Klass.asyncMethod.mostRecentCall.args[0](someResponseData);
expect(callback).wasCalledWith(someResponseData);
});
There are spy-specfic matchers that are very handy.
`expect(x).wasCalled()` passes if `x` is a spy and was called
`expect(x).wasCalledWith(arguments)` passes if `x` is a spy and was called with the specified arguments
`expect(x).wasNotCalled()` passes if `x` is a spy and was not called
`expect(x).wasNotCalledWith(arguments)` passes if `x` is a spy and was not called with the specified arguments
Spies can be trained to respond in a variety of ways when invoked:
`spyOn(x, 'method').andCallThrough()`: spies on AND calls the original function spied on
`spyOn(x, 'method').andReturn(arguments)`: returns passed arguments when spy is called
`spyOn(x, 'method').andThrow(exception)`: throws passed exception when spy is called
`spyOn(x, 'method').andCallFake(function)`: calls passed function when spy is called
Spies have some useful properties:
`callCount`: returns number of times spy was called
`mostRecentCall.args`: returns argument array from last call to spy.
`argsForCall[i]` returns arguments array for call `i` to spy.
Spies are automatically removed after each spec. They may be set in the beforeEach function.
### Disabling Tests & Suites
Specs may be disabled by calling `xit()` instead of `it()`. Suites may be disabled by calling `xdescribe()` instead of `describe()`. A simple find/replace in your editor of choice will allow you to run a subset of your specs.
### Asynchronous Specs
You may be thinking, "That's all very nice, but what's this about asynchronous tests?"
Well, say you need to make a call that is asynchronous - an AJAX API, event callback, or some other JavaScript library. That is, the call returns immediately, yet you want to make expectations 'at some point in the future' after some magic happens in the background.
Jasmine allows you to do this with `runs()` and `waits()` blocks.
`runs()` blocks by themselves simply run as if they were called directly. The following snippets of code should provide similar results:
it('should be a test', function () {
var foo = 0
foo++;
expect(foo).toEqual(1);
});
and
it('should be a test', function () {
runs( function () {
var foo = 0
foo++;
expect(foo).toEqual(1);
});
});
multiple `runs()` blocks in a spec will run serially. For example,
it('should be a test', function () {
runs( function () {
var foo = 0
foo++;
expect(foo).toEqual(1);
});
runs( function () {
var bar = 0
bar++;
expect(bar).toEqual(1);
});
});
`runs()` blocks share functional scope -- `this` properties will be common to all blocks, but declared `var`'s will not!
it('should be a test', function () {
runs( function () {
this.foo = 0
this.foo++;
var bar = 0;
bar++;
expect(this.foo).toEqual(1);
expect(bar).toEqual(1);
});
runs( function () {
this.foo++;
var bar = 0
bar++;
expect(foo).toEqual(2);
expect(bar).toEqual(1);
});
});
`runs()` blocks exist so you can test asynchronous processes. The function `waits()` works with `runs()` to provide a naive
timeout before the next block is run. You supply a time to wait before the next `runs()` function is executed. For example:
it('should be a test', function () {
runs(function () {
this.foo = 0;
var that = this;
setTimeout(function () {
that.foo++;
}, 250);
});
runs(function () {
this.expects(this.foo).toEqual(0);
});
waits(500);
runs(function () {
this.expects(this.foo).toEqual(1);
});
});
What's happening here?
* The first call to `runs()` sets call for 1/4 of a second in the future that increments `this.foo`.
* The second `runs()` is executed immediately and then verifies that `this.foo` was indeed initialized to zero in the previous `runs()`.
* Then we wait for half a second.
* Then the last call to `runs()` expects that `this.foo` was incremented by the `setTimeout`.
## Support ## Support
We now have a Google Group for support & discussion.
* Homepage: [http://groups.google.com/group/jasmine-js](http://groups.google.com/group/jasmine-js) * Search past discussions: [http://groups.google.com/group/jasmine-js](http://groups.google.com/group/jasmine-js)
* Group email: [jasmine-js@googlegroups.com](jasmine-js@googlegroups.com) * Send an email to the list: [jasmine-js@googlegroups.com](jasmine-js@googlegroups.com)
* Current build status of Jasmine is visible at [ci.pivotallabs.com](http://ci.pivotallabs.com) * Check the current build status: [ci.pivotallabs.com](http://ci.pivotallabs.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)
## 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.
### Development Environment
Jasmine Core relies on Ruby for executing the test suite and building the project for release. The spec suite runs in any major, modern browser (Firefox, Safari, Chrome, and yes various IE's) and in [Node.js](http://nodejs.org). While you probably have browsers installed, you want to make sure that Ruby and Node are present.
### How to Develop for Jasmine Core
* Write specs
* Make them pass in a browser (or three):
* open `spec/runner.html` in your browsers
* `rake spec:browser` will run in the default browser on MacOS
* Make them pass in Node: `rake spec:node`
* Fix any warnings or errors from JSHint: `rake jasmine:lint`
Running `rake spec` will run the browser tests, then run specs in Node, then run JSHint. But this will only run in the default browser and only on MacOS (for now).
### Making a Successful Pull Request
* __Include specs for your work__ - it helps us understand your intent and makes sure that future development doesn't break your work
* __Ensure the full test suite is green__ in all the big browsers, Node, and JSHint - your contribution shouldn't break Jasmine for other users
Do these things and we'll take a look.
## Maintainers ## Maintainers
* [Davis W. Frank](mailto:dwfrank@pivotallabs.com), Pivotal Labs * [Davis W. Frank](mailto:dwfrank@pivotallabs.com), Pivotal Labs
* [Rajan Agaskar](mailto:rajan@pivotallabs.com), Pivotal Labs * [Rajan Agaskar](mailto:rajan@pivotallabs.com), Pivotal Labs
* [Christian Williams](mailto:xian@pivotallabs.com), Pivotal Labs * [Christian Williams](mailto:antixian666@gmail.com), Square
## Acknowledgments Copyright (c) 2008-2011 Pivotal Labs. This software is licensed under the MIT License.
* A big shout out to the various JavaScript test framework authors, especially TJ for [JSpec](http://github.com/visionmedia/jspec/tree/master) - we played with it a bit before deciding that we really needed to roll our own.
* Thanks to Pivot [Jessica Miller](http://www.jessicamillerworks.com/) for our fancy pass/fail/pending icons
* Huge contributions have been made by [Erik Hanson](mailto:erik@pivotallabs.com), [Adam Abrons](mailto:adam@pivotallabs.com) and [Carl Jackson](mailto:carl@pivotallabs.com), and many other Pivots.

217
Rakefile
View File

@ -1,155 +1,170 @@
require File.expand_path(File.join(File.dirname(__FILE__), "spec/jasmine_helper.rb")) require 'json'
def jasmine_sources def jasmine_sources
sources = ["src/base.js", "src/util.js", "src/Env.js", "src/Reporter.js", "src/Block.js"] first_sources = JSON.parse(File.read('src/SourcesList.json')).collect {|f| "src/core/#{f}"}
sources += Dir.glob('src/*.js').reject{|f| f == 'src/base.js' || sources.include?(f)}.sort
sources = first_sources
sources += Dir.glob('src/core/*.js').reject {|f| first_sources.include?(f)}.sort
sources sources
end end
def jasmine_filename(version) def jasmine_html_sources
"jasmine-#{version['major']}.#{version['minor']}.#{version['build']}.js" ["src/html/TrivialReporter.js"]
end
def jasmine_version
"#{version_hash['major']}.#{version_hash['minor']}.#{version_hash['build']}"
end end
def version_hash def version_hash
JSON.parse(File.new("src/version.json").read); require 'json'
@version ||= JSON.parse(File.new("src/core/version.json").read);
end end
def start_jasmine_server(jasmine_includes = nil)
require File.expand_path(File.join(JasmineHelper.jasmine_root, "contrib/ruby/jasmine_spec_builder"))
puts "your tests are here:" def substitute_jasmine_version(filename)
puts " http://localhost:8888/run.html" contents = File.read(filename)
contents = contents.gsub(/##JASMINE_VERSION##/, (jasmine_version))
Jasmine::SimpleServer.start( contents = contents.gsub(/[^\n]*REMOVE_THIS_LINE_FROM_BUILD[^\n]*/, '')
8888, File.open(filename, 'w') { |f| f.write(contents) }
lambda { JasmineHelper.specs },
JasmineHelper.dir_mappings,
:jasmine_files => jasmine_includes)
end end
task :default => 'jasmine:dist' task :default => :spec
desc "Run spec suite: Browser, Node, JSHint"
task :spec => ["jasmine:build", "spec:node", "spec:browser"]
namespace :spec do
desc 'Run specs in Node.js'
task :node do
raise "Node is required to run all jasmine specs" unless system("node spec/node_suite.js")
end
desc "Run specs in the default browser (MacOS only)"
task :browser do
system("open spec/runner.html")
end
end
namespace :jasmine do namespace :jasmine do
desc 'Prepares for distribution' desc 'Prepares for distribution'
task :dist => ['jasmine:build', 'jasmine:doc'] task :dist => ['jasmine:build',
'jasmine:doc',
'jasmine:build_pages',
'jasmine:build_example_project',
'jasmine:fill_index_downloads']
desc 'Check jasmine sources for coding problems' desc 'Check jasmine sources for coding problems'
task :lint do task :lint do
passed = true puts "Running JSHint via Node.js"
jasmine_sources.each do |src| system("node jshint/run.js") || exit(1)
lines = File.read(src).split(/\n/)
lines.each_index do |i|
line = lines[i]
undefineds = line.scan(/.?undefined/)
if undefineds.include?(" undefined") || undefineds.include?("\tundefined")
puts "Dangerous undefined at #{src}:#{i}:\n > #{line}"
passed = false
end
end
end
unless passed
puts "Lint failed!"
exit 1
end
end end
desc "Alias to JSHint"
task :hint => :lint
desc 'Builds lib/jasmine from source' desc 'Builds lib/jasmine from source'
task :build => [:lint, 'gems:geminstaller'] do task :build => :lint do
puts 'Building Jasmine from source' puts 'Building Jasmine from source'
require 'json'
sources = jasmine_sources sources = jasmine_sources
version = version_hash version = version_hash
old_jasmine_files = Dir.glob('lib/jasmine*.js') File.open("lib/jasmine.js", 'w') do |jasmine|
old_jasmine_files.each do |file| sources.each do |source_filename|
File.delete(file) jasmine.puts(File.read(source_filename))
end end
jasmine = File.new("lib/#{jasmine_filename version}", 'w') jasmine.puts %{
sources.each do |source_filename|
jasmine.puts(File.read(source_filename))
end
jasmine.puts %{
jasmine.version_= { jasmine.version_= {
"major": #{version['major']}, "major": #{version['major'].to_json},
"minor": #{version['minor']}, "minor": #{version['minor'].to_json},
"build": #{version['build']}, "build": #{version['build'].to_json},
"revision": #{Time.now.to_i} "revision": #{Time.now.to_i}
}; };
} }
end
jasmine.close File.open("lib/jasmine-html.js", 'w') do |jasmine_html|
jasmine_html_sources.each do |source_filename|
jasmine_html.puts(File.read(source_filename))
end
end
FileUtils.cp("src/html/jasmine.css", "lib/jasmine.css")
end
downloads_file = 'pages/download.html'
task :need_pages_submodule do
unless File.exist?(downloads_file)
raise "Jasmine pages submodule isn't present. Run git submodule update --init"
end
end
desc "Build the Github pages HTML"
task :build_pages => :need_pages_submodule do
Dir.chdir("pages") do
FileUtils.rm_r('pages_output') if File.exist?('pages_output')
Dir.chdir('pages_source') do
system("frank export ../pages_output")
end
puts "\nCopying Frank output to the root of the gh-pages branch\n\n"
system("cp -r pages_output/* .")
end
end end
desc "Build jasmine documentation" desc "Build jasmine documentation"
task :doc do task :doc => :need_pages_submodule do
puts 'Creating Jasmine Documentation' puts 'Creating Jasmine Documentation'
require 'rubygems' require 'rubygems'
#sudo gem install ragaskar-jsdoc_helper
require 'jsdoc_helper' require 'jsdoc_helper'
FileUtils.rm_r "pages/jsdoc", :force => true
JsdocHelper::Rake::Task.new(:lambda_jsdoc) do |t| JsdocHelper::Rake::Task.new(:lambda_jsdoc) do |t|
t[:files] = jasmine_sources << 'lib/TrivialReporter.js' t[:files] = jasmine_sources << jasmine_html_sources
t[:options] = "-a" t[:options] = "-a"
t[:out] = "pages/jsdoc"
# JsdocHelper bug: template must be relative to the JsdocHelper gem, ick
t[:template] = File.join("../".*(100), Dir::getwd, "jsdoc-template")
end end
Rake::Task[:lambda_jsdoc].invoke Rake::Task[:lambda_jsdoc].invoke
end end
desc "Build example project"
task :build_example_project => :need_pages_submodule do
require 'tmpdir'
desc "Run jasmine tests of source via server" temp_dir = File.join(Dir.tmpdir, 'jasmine-standalone-project')
task :server do puts "Building Example Project in #{temp_dir}"
files = jasmine_sources + ['lib/TrivialReporter.js', 'lib/consolex.js'] FileUtils.rm_r temp_dir if File.exist?(temp_dir)
jasmine_includes = lambda { Dir.mkdir(temp_dir)
raw_jasmine_includes = files.collect { |f| File.expand_path(File.join(JasmineHelper.jasmine_root, f)) }
Jasmine.cachebust(raw_jasmine_includes).collect {|f| f.sub(JasmineHelper.jasmine_src_dir, "/src").sub(JasmineHelper.jasmine_lib_dir, "/lib") }
}
start_jasmine_server(jasmine_includes)
end
desc "Build jasmine and run tests via server" root = File.expand_path(File.dirname(__FILE__))
task :server_build => 'jasmine:build' do FileUtils.cp_r File.join(root, 'example/.'), File.join(temp_dir)
substitute_jasmine_version(File.join(temp_dir, "SpecRunner.html"))
start_jasmine_server lib_dir = File.join(temp_dir, "lib/jasmine-#{jasmine_version}")
end FileUtils.mkdir_p(lib_dir)
{
namespace :test do "lib/jasmine.js" => "jasmine.js",
desc "Run continuous integration tests using a local Selenium runner" "lib/jasmine-html.js" => "jasmine-html.js",
task :ci => :'ci:local' "src/html/jasmine.css" => "jasmine.css",
namespace :ci do "MIT.LICENSE" => "MIT.LICENSE"
}.each_pair do |src, dest|
task :local => 'jasmine:build' do FileUtils.cp(File.join(root, src), File.join(lib_dir, dest))
require "spec"
require 'spec/rake/spectask'
Spec::Rake::SpecTask.new(:lambda_ci) do |t|
t.spec_opts = ["--color", "--format", "specdoc"]
t.spec_files = ["spec/jasmine_spec.rb"]
end
Rake::Task[:lambda_ci].invoke
end
desc "Run continuous integration tests using Sauce Labs 'Selenium in the Cloud'"
task :saucelabs => ['jasmine:copy_saucelabs_config', 'jasmine:build'] do
ENV['SAUCELABS'] = 'true'
Rake::Task['jasmine:test:ci:local'].invoke
end
end end
dist_dir = File.join(root, 'pages/downloads')
zip_file_name = File.join(dist_dir, "jasmine-standalone-#{jasmine_version}.zip")
puts "Zipping Example Project and moving to #{zip_file_name}"
FileUtils.mkdir(dist_dir) unless File.exist?(dist_dir)
if File.exist?(zip_file_name)
puts "WARNING!!! #{zip_file_name} already exists!"
FileUtils.rm(zip_file_name)
end
exec "cd #{temp_dir} && zip -r #{zip_file_name} . -x .[a-zA-Z0-9]*"
end end
desc 'Copy saucelabs.yml to work directory'
task 'copy_saucelabs_config' do
FileUtils.cp '../saucelabs.yml', 'spec'
end
end
namespace :gems do
desc "Run geminstaller."
task :geminstaller do
`geminstaller --sudo`
end
end end

View File

@ -1,334 +0,0 @@
require 'socket'
require 'erb'
require 'json'
module Jasmine
def self.root
File.expand_path(File.join(File.dirname(__FILE__), '../..'))
end
# this seemingly-over-complex method is necessary to get an open port on at least some of our Macs
def self.open_socket_on_unused_port
infos = Socket::getaddrinfo("localhost", nil, Socket::AF_UNSPEC, Socket::SOCK_STREAM, 0, Socket::AI_PASSIVE)
families = Hash[*infos.collect { |af, *_| af }.uniq.zip([]).flatten]
return TCPServer.open('0.0.0.0', 0) if families.has_key?('AF_INET')
return TCPServer.open('::', 0) if families.has_key?('AF_INET6')
return TCPServer.open(0)
end
def self.find_unused_port
socket = open_socket_on_unused_port
port = socket.addr[1]
socket.close
port
end
def self.server_is_listening_on(hostname, port)
require 'socket'
begin
socket = TCPSocket.open(hostname, port)
rescue Errno::ECONNREFUSED
return false
end
socket.close
true
end
def self.wait_for_listener(port, name = "required process", seconds_to_wait = 10)
time_out_at = Time.now + seconds_to_wait
until server_is_listening_on "localhost", port
sleep 0.1
puts "Waiting for #{name} on #{port}..."
raise "#{name} didn't show up on port #{port} after #{seconds_to_wait} seconds." if Time.now > time_out_at
end
end
def self.kill_process_group(process_group_id, signal="TERM")
Process.kill signal, -process_group_id # negative pid means kill process group. (see man 2 kill)
end
def self.cachebust(files, root_dir="", replace=nil, replace_with=nil)
require 'digest/md5'
files.collect do |file_name|
real_file_name = replace && replace_with ? file_name.sub(replace, replace_with) : file_name
begin
digest = Digest::MD5.hexdigest(File.read("#{root_dir}#{real_file_name}"))
rescue
digest = "MISSING-FILE"
end
"#{file_name}?cachebust=#{digest}"
end
end
class RunAdapter
def initialize(spec_files_or_proc, options = {})
@spec_files_or_proc = Jasmine.files(spec_files_or_proc) || []
@jasmine_files = Jasmine.files(options[:jasmine_files]) || [
"/__JASMINE_ROOT__/lib/" + File.basename(Dir.glob("#{Jasmine.root}/lib/jasmine*.js").first),
"/__JASMINE_ROOT__/lib/TrivialReporter.js",
"/__JASMINE_ROOT__/lib/json2.js",
"/__JASMINE_ROOT__/lib/consolex.js",
]
@stylesheets = ["/__JASMINE_ROOT__/lib/jasmine.css"] + (Jasmine.files(options[:stylesheets]) || [])
@spec_helpers = Jasmine.files(options[:spec_helpers]) || []
end
def call(env)
run
end
def run
stylesheets = @stylesheets
spec_helpers = @spec_helpers
spec_files = @spec_files_or_proc
jasmine_files = @jasmine_files
jasmine_files = jasmine_files.call if jasmine_files.respond_to?(:call)
css_files = @stylesheets
body = ERB.new(File.read(File.join(File.dirname(__FILE__), "run.html"))).result(binding)
[
200,
{ 'Content-Type' => 'text/html' },
body
]
end
end
class Redirect
def initialize(url)
@url = url
end
def call(env)
[
302,
{ 'Location' => @url },
[]
]
end
end
class JsAlert
def call(env)
[
200,
{ 'Content-Type' => 'application/javascript' },
"document.write('<p>Couldn\\'t load #{env["PATH_INFO"]}!</p>');"
]
end
end
class FocusedSuite
def initialize(spec_files_or_proc, options)
@spec_files_or_proc = Jasmine.files(spec_files_or_proc) || []
@options = options
end
def call(env)
spec_files = @spec_files_or_proc
matching_specs = spec_files.select {|spec_file| spec_file =~ /#{Regexp.escape(env["PATH_INFO"])}/ }.compact
if !matching_specs.empty?
run_adapter = Jasmine::RunAdapter.new(matching_specs, @options)
run_adapter.run
else
[
200,
{ 'Content-Type' => 'application/javascript' },
"document.write('<p>Couldn\\'t find any specs matching #{env["PATH_INFO"]}!</p>');"
]
end
end
end
class SimpleServer
def self.start(port, spec_files_or_proc, mappings, options = {})
require 'thin'
config = {
'/__suite__' => Jasmine::FocusedSuite.new(spec_files_or_proc, options),
'/run.html' => Jasmine::Redirect.new('/'),
'/' => Jasmine::RunAdapter.new(spec_files_or_proc, options)
}
mappings.each do |from, to|
config[from] = Rack::File.new(to)
end
config["/__JASMINE_ROOT__"] = Rack::File.new(Jasmine.root)
app = Rack::Cascade.new([
Rack::URLMap.new(config),
JsAlert.new
])
begin
Thin::Server.start('0.0.0.0', port, app)
rescue RuntimeError => e
raise e unless e.message == 'no acceptor'
raise RuntimeError.new("A server is already running on port #{port}")
end
end
end
class SimpleClient
def initialize(selenium_host, selenium_port, selenium_browser_start_command, http_address)
require 'selenium/client'
@driver = Selenium::Client::Driver.new(
selenium_host,
selenium_port,
selenium_browser_start_command,
http_address
)
@http_address = http_address
end
def tests_have_finished?
@driver.get_eval("window.jasmine.getEnv().currentRunner.finished") == "true"
end
def connect
@driver.start
@driver.open("/")
end
def disconnect
@driver.stop
end
def run
until tests_have_finished? do
sleep 0.1
end
puts @driver.get_eval("window.results()")
failed_count = @driver.get_eval("window.jasmine.getEnv().currentRunner.results().failedCount").to_i
failed_count == 0
end
def eval_js(script)
escaped_script = "'" + script.gsub(/(['\\])/) { '\\' + $1 } + "'"
result = @driver.get_eval(" try { eval(#{escaped_script}, window); } catch(err) { window.eval(#{escaped_script}); }")
JSON.parse("[#{result}]")[0]
end
end
class Runner
def initialize(selenium_jar_path, spec_files, dir_mappings, options={})
@selenium_jar_path = selenium_jar_path
@spec_files = spec_files
@dir_mappings = dir_mappings
@options = options
@browser = options[:browser] ? options[:browser].delete(:browser) : 'firefox'
@selenium_pid = nil
@jasmine_server_pid = nil
@selenium_host = 'localhost'
@jasmine_server_port = Jasmine::find_unused_port
@selenium_server_port = Jasmine::find_unused_port
end
def start
start_jasmine_server
start_selenium_server
@client = Jasmine::SimpleClient.new(@selenium_host, @selenium_server_port, "*#{@browser}", "http://localhost:#{@jasmine_server_port}/")
@client.connect
end
def stop
@client.disconnect
stop_selenium_server
stop_jasmine_server
end
def start_jasmine_server
@jasmine_server_pid = fork do
Process.setpgrp
Jasmine::SimpleServer.start(@jasmine_server_port, @spec_files, @dir_mappings, @options)
exit! 0
end
puts "jasmine server started. pid is #{@jasmine_server_pid}"
Jasmine::wait_for_listener(@jasmine_server_port, "jasmine server")
end
def start_selenium_server
@selenium_pid = fork do
Process.setpgrp
exec "java -jar #{@selenium_jar_path} -port #{@selenium_server_port} > /dev/null 2>&1"
end
puts "selenium started. pid is #{@selenium_pid}"
Jasmine::wait_for_listener(@selenium_server_port, "selenium server")
end
def stop_jasmine_server
puts "shutting down Jasmine server..."
Jasmine::kill_process_group(@jasmine_server_pid) if @jasmine_server_pid
end
def stop_selenium_server
puts "shutting down Selenium server..."
Jasmine::kill_process_group(@selenium_pid) if @selenium_pid
end
def run
begin
start
puts "servers are listening on their ports -- running the test script..."
tests_passed = @client.run
ensure
stop
end
return tests_passed
end
def eval_js(script)
@client.eval_js(script)
end
end
class SauceLabsRunner < Runner
def initialize(spec_files, dir_mappings, options={})
@spec_files = spec_files
@dir_mappings = dir_mappings
@options = options
@browser = options[:browser] ? options[:browser].delete(:browser) : 'firefox'
@jasmine_server_pid = nil
@jasmine_server_port = Jasmine::find_unused_port
@saucelabs_config = SeleniumConfig.new(options[:saucelabs_config], options[:saucelabs_config_file], @jasmine_server_port)
end
def start_selenium_server
@sauce_tunnel = SauceTunnel.new(@saucelabs_config)
end
def start
start_jasmine_server
start_selenium_server
@client = Jasmine::SimpleClient.new(@saucelabs_config['selenium_server_address'],
4444,
@saucelabs_config['selenium_browser_key'],
"http://#{@saucelabs_config['application_address']}")
@client.connect
end
def stop
@client.disconnect
@sauce_tunnel.shutdown
stop_jasmine_server
end
end
def self.files(f)
result = f
result = result.call if result.respond_to?(:call)
result
end
end

View File

@ -1,153 +0,0 @@
require File.expand_path(File.join(File.dirname(__FILE__), "jasmine_runner.rb"))
require 'enumerator'
module Jasmine
class SpecBuilder
attr_accessor :suites
def initialize(spec_files, runner)
@spec_files = spec_files
@runner = runner
@spec_ids = []
end
def start
guess_example_locations
@runner.start
load_suite_info
wait_for_suites_to_finish_running
end
def stop
@runner.stop
end
def script_path
File.expand_path(__FILE__)
end
def guess_example_locations
@example_locations = {}
example_name_parts = []
previous_indent_level = 0
@spec_files.each do |filename|
line_number = 1
File.open(filename, "r") do |file|
file.readlines.each do |line|
match = /^(\s*)(describe|it)\s*\(\s*["'](.*)["']\s*,\s*function/.match(line)
if (match)
indent_level = match[1].length / 2
example_name = match[3]
example_name_parts[indent_level] = example_name
full_example_name = example_name_parts.slice(0, indent_level + 1).join(" ")
@example_locations[full_example_name] = "#{filename}:#{line_number}: in `it'"
end
line_number += 1
end
end
end
end
def load_suite_info
started = Time.now
while !eval_js('jsApiReporter && jsApiReporter.started') do
raise "couldn't connect to Jasmine after 60 seconds" if (started + 60 < Time.now)
sleep 0.1
end
@suites = eval_js("var result = jsApiReporter.suites(); if (window.Prototype && result && result.toJSON) { result.toJSON()} else { JSON.stringify(result) }")
end
def results_for(spec_id)
@spec_results ||= load_results
@spec_results[spec_id.to_s]
end
def load_results
@spec_results = {}
@spec_ids.each_slice(50) do |slice|
@spec_results.merge!(eval_js("var result = jsApiReporter.resultsForSpecs(#{JSON.generate(slice)}); if (window.Prototype && result && result.toJSON) { result.toJSON()} else { JSON.stringify(result) }"))
end
@spec_results
end
def wait_for_suites_to_finish_running
puts "Waiting for suite to finish in browser ..."
while !eval_js('jsApiReporter.finished') do
sleep 0.1
end
end
def declare_suites
me = self
suites.each do |suite|
declare_suite(self, suite)
end
end
def declare_suite(parent, suite)
me = self
parent.describe suite["name"] do
suite["children"].each do |suite_or_spec|
type = suite_or_spec["type"]
if type == "suite"
me.declare_suite(self, suite_or_spec)
elsif type == "spec"
me.declare_spec(self, suite_or_spec)
else
raise "unknown type #{type} for #{suite_or_spec.inspect}"
end
end
end
end
def declare_spec(parent, spec)
me = self
example_name = spec["name"]
@spec_ids << spec["id"]
backtrace = @example_locations[parent.description + " " + example_name]
parent.it example_name, {}, backtrace do
me.report_spec(spec["id"])
end
end
def report_spec(spec_id)
spec_results = results_for(spec_id)
out = ""
messages = spec_results['messages'].each do |message|
case
when message["type"] == "MessageResult"
puts message["text"]
puts "\n"
else
unless message["message"] =~ /^Passed.$/
STDERR << message["message"]
STDERR << "\n"
out << message["message"]
out << "\n"
end
if !message["passed"] && message["trace"]["stack"]
stack_trace = message["trace"]["stack"].gsub(/<br \/>/, "\n").gsub(/<\/?b>/, " ")
STDERR << stack_trace.gsub(/\(.*\)@http:\/\/localhost:[0-9]+\/specs\//, "/spec/")
STDERR << "\n"
end
end
end
fail out unless spec_results['result'] == 'passed'
puts out unless out.empty?
end
private
def eval_js(js)
@runner.eval_js(js)
end
end
end

View File

@ -1,47 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type"/>
<title>Jasmine suite</title>
<% css_files.each do |css_file| %>
<link rel="stylesheet" href="<%= css_file %>" type="text/css" media="screen"/>
<% end %>
<% jasmine_files.each do |jasmine_file| %>
<script src="<%= jasmine_file %>" type="text/javascript"></script>
<% end %>
<% spec_helpers.each do |spec_helper| %>
<script src="<%= spec_helper %>" type="text/javascript"></script>
<% end %>
<script type="text/javascript">
var jsApiReporter;
(function() {
var jasmineEnv = jasmine.getEnv();
jsApiReporter = new jasmine.JsApiReporter();
var trivialReporter = new jasmine.TrivialReporter();
jasmineEnv.addReporter(jsApiReporter);
jasmineEnv.addReporter(trivialReporter);
jasmineEnv.specFilter = function(spec) {
return trivialReporter.specFilter(spec);
};
window.onload = function() {
jasmineEnv.execute();
};
})();
</script>
<% spec_files.each do |spec_file| %>
<script src="<%= spec_file %>" type="text/javascript"></script>
<% end %>
</head>
<body>
<div id="jasmine_content"></div>
</body>
</html>

View File

@ -1,71 +0,0 @@
require 'spec'
require 'open-uri'
require 'thin'
require File.dirname(__FILE__) + '/../jasmine_runner'
describe Jasmine::SimpleServer do
before do
@port = Jasmine::find_unused_port
end
after do
Jasmine::kill_process_group(@jasmine_server_pid) if @jasmine_server_pid
end
it "should start and print script tags" do
@jasmine_server_pid = fork do
Process.setpgrp
Jasmine::SimpleServer.start(@port, ["file1", "file2"], {})
exit! 0
end
Jasmine::wait_for_listener(@port)
run_html = open("http://localhost:#{@port}/").read
run_html.should =~ /<script src="file1"/
run_html.should =~ /<script src="file2"/
end
describe "RuntimeError" do
it "should throw an Already Running error if there is already a server running" do
Thin::Server.should_receive(:start).and_raise(RuntimeError.new('no acceptor'))
lambda {
Jasmine::SimpleServer.start(@port, ["file1", "file2"], {})
}.should raise_error(RuntimeError, "A server is already running on port #{@port}")
end
it "re-raises other RuntimeErrors" do
Thin::Server.should_receive(:start).and_raise(RuntimeError.new('some random error'))
lambda {
Jasmine::SimpleServer.start(@port, ["file1", "file2"], {})
}.should raise_error(RuntimeError, "some random error")
end
end
it "should take a proc that returns a list of spec files" do
spec_fileses = [["file1", "file2"], ["file1", "file2", "file3"]]
spec_files_proc = lambda do
spec_fileses.shift
end
@jasmine_server_pid = fork do
Process.setpgrp
Jasmine::SimpleServer.start(@port, spec_files_proc, {})
exit! 0
end
Jasmine::wait_for_listener(@port)
run_html = open("http://localhost:#{@port}/").read
run_html.should =~ /<script src="file1"/
run_html.should =~ /<script src="file2"/
run_html = open("http://localhost:#{@port}/").read
run_html.should =~ /<script src="file1"/
run_html.should =~ /<script src="file2"/
run_html.should =~ /<script src="file3"/
end
end

View File

@ -1,460 +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=utf-8"" />
<title>JsDoc Reference - File Index</title>
<meta name="generator" content="JsDoc Toolkit" />
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<div id="header">
</div>
<div id="index">
<div align="center"><a href="index.html">Class Index</a>
| <a href="files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="symbols/_global_.html">_global_</a></i></li>
<li><a href="symbols/jasmine.html">jasmine</a></li>
<li><a href="symbols/jasmine.Block.html">jasmine.Block</a></li>
<li><a href="symbols/jasmine.Clock.html">jasmine.Clock</a></li>
<li><a href="symbols/jasmine.Env.html">jasmine.Env</a></li>
<li><a href="symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
<li><a href="symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
<li><a href="symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
<li><a href="symbols/jasmine.Runner.html">jasmine.Runner</a></li>
<li><a href="symbols/jasmine.Spec.html">jasmine.Spec</a></li>
<li><a href="symbols/jasmine.Spy.html">jasmine.Spy</a></li>
<li><a href="symbols/jasmine.Suite.html">jasmine.Suite</a></li>
<li><a href="symbols/jasmine.util.html">jasmine.util</a></li>
</ul>
<hr />
</div>
<div id="content">
<h1 class="classTitle">File Index</h1>
<div>
<h2><a href="symbols/src/lib_TrivialReporter.js.html">lib/TrivialReporter.js</a></h2>
<dl>
</dl>
</div>
<hr />
<div>
<h2><a href="symbols/src/src_base.js.html">src/base.js</a></h2>
<dl>
</dl>
</div>
<hr />
<div>
<h2><a href="symbols/src/src_Block.js.html">src/Block.js</a></h2>
<dl>
</dl>
</div>
<hr />
<div>
<h2><a href="symbols/src/src_Env.js.html">src/Env.js</a></h2>
<dl>
</dl>
</div>
<hr />
<div>
<h2><a href="symbols/src/src_JsApiReporter.js.html">src/JsApiReporter.js</a></h2>
<dl>
</dl>
</div>
<hr />
<div>
<h2><a href="symbols/src/src_Matchers.js.html">src/Matchers.js</a></h2>
<dl>
</dl>
</div>
<hr />
<div>
<h2><a href="symbols/src/src_mock-timeout.js.html">src/mock-timeout.js</a></h2>
<dl>
</dl>
</div>
<hr />
<div>
<h2><a href="symbols/src/src_MultiReporter.js.html">src/MultiReporter.js</a></h2>
<dl>
</dl>
</div>
<hr />
<div>
<h2><a href="symbols/src/src_NestedResults.js.html">src/NestedResults.js</a></h2>
<dl>
</dl>
</div>
<hr />
<div>
<h2><a href="symbols/src/src_PrettyPrinter.js.html">src/PrettyPrinter.js</a></h2>
<dl>
</dl>
</div>
<hr />
<div>
<h2><a href="symbols/src/src_Queue.js.html">src/Queue.js</a></h2>
<dl>
</dl>
</div>
<hr />
<div>
<h2><a href="symbols/src/src_Reporter.js.html">src/Reporter.js</a></h2>
<dl>
</dl>
</div>
<hr />
<div>
<h2><a href="symbols/src/src_Reporters.js.html">src/Reporters.js</a></h2>
<dl>
</dl>
</div>
<hr />
<div>
<h2><a href="symbols/src/src_Runner.js.html">src/Runner.js</a></h2>
<dl>
</dl>
</div>
<hr />
<div>
<h2><a href="symbols/src/src_Spec.js.html">src/Spec.js</a></h2>
<dl>
</dl>
</div>
<hr />
<div>
<h2><a href="symbols/src/src_Suite.js.html">src/Suite.js</a></h2>
<dl>
</dl>
</div>
<hr />
<div>
<h2><a href="symbols/src/src_util.js.html">src/util.js</a></h2>
<dl>
</dl>
</div>
<hr />
<div>
<h2><a href="symbols/src/src_WaitsBlock.js.html">src/WaitsBlock.js</a></h2>
<dl>
</dl>
</div>
<hr />
<div>
<h2><a href="symbols/src/src_WaitsForBlock.js.html">src/WaitsForBlock.js</a></h2>
<dl>
</dl>
</div>
<hr />
</div>
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:22 GMT-0800 (PST)
</div>
</body>
</html>

View File

@ -1,322 +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=utf-8"" />
<title>JsDoc Reference - Index</title>
<meta name="generator" content="JsDoc Toolkit" />
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<div id="header">
</div>
<div id="index">
<div align="center"><a href="index.html">Class Index</a>
| <a href="files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="symbols/_global_.html">_global_</a></i></li>
<li><a href="symbols/jasmine.html">jasmine</a></li>
<li><a href="symbols/jasmine.Block.html">jasmine.Block</a></li>
<li><a href="symbols/jasmine.Clock.html">jasmine.Clock</a></li>
<li><a href="symbols/jasmine.Env.html">jasmine.Env</a></li>
<li><a href="symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
<li><a href="symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
<li><a href="symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
<li><a href="symbols/jasmine.Runner.html">jasmine.Runner</a></li>
<li><a href="symbols/jasmine.Spec.html">jasmine.Spec</a></li>
<li><a href="symbols/jasmine.Spy.html">jasmine.Spy</a></li>
<li><a href="symbols/jasmine.Suite.html">jasmine.Suite</a></li>
<li><a href="symbols/jasmine.util.html">jasmine.util</a></li>
</ul>
<hr />
</div>
<div id="content">
<h1 class="classTitle">Class Index</h1>
<div>
<h2><a href="symbols/_global_.html">_global_</a></h2>
</div>
<hr />
<div>
<h2><a href="symbols/jasmine.html">jasmine</a></h2>
</div>
<hr />
<div>
<h2><a href="symbols/jasmine.Block.html">jasmine.Block</a></h2>
</div>
<hr />
<div>
<h2><a href="symbols/jasmine.Clock.html">jasmine.Clock</a></h2>
</div>
<hr />
<div>
<h2><a href="symbols/jasmine.Env.html">jasmine.Env</a></h2>
</div>
<hr />
<div>
<h2><a href="symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></h2>
</div>
<hr />
<div>
<h2><a href="symbols/jasmine.Matchers.html">jasmine.Matchers</a></h2>
</div>
<hr />
<div>
<h2><a href="symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></h2>
</div>
<hr />
<div>
<h2><a href="symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></h2>
</div>
<hr />
<div>
<h2><a href="symbols/jasmine.Reporter.html">jasmine.Reporter</a></h2>
</div>
<hr />
<div>
<h2><a href="symbols/jasmine.Runner.html">jasmine.Runner</a></h2>
</div>
<hr />
<div>
<h2><a href="symbols/jasmine.Spec.html">jasmine.Spec</a></h2>
</div>
<hr />
<div>
<h2><a href="symbols/jasmine.Spy.html">jasmine.Spy</a></h2>
</div>
<hr />
<div>
<h2><a href="symbols/jasmine.Suite.html">jasmine.Suite</a></h2>
</div>
<hr />
<div>
<h2><a href="symbols/jasmine.util.html">jasmine.util</a></h2>
</div>
<hr />
</div>
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:22 GMT-0800 (PST)
</div>
</body>
</html>

View File

@ -1,918 +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=utf-8" />
<meta name="generator" content="JsDoc Toolkit" />
<title>JsDoc Reference - _global_</title>
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<!-- ============================== header ================================= -->
<!-- begin static/header.html -->
<div id="header">
</div>
<!-- end static/header.html -->
<!-- ============================== classes index ============================ -->
<div id="index">
<!-- begin publish.classesIndex -->
<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
<li><a href="../symbols/jasmine.html">jasmine</a></li>
<li><a href="../symbols/jasmine.Block.html">jasmine.Block</a></li>
<li><a href="../symbols/jasmine.Clock.html">jasmine.Clock</a></li>
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
<li><a href="../symbols/jasmine.util.html">jasmine.util</a></li>
</ul>
<hr />
<!-- end publish.classesIndex -->
</div>
<div id="content">
<!-- ============================== class title ============================ -->
<h1 class="classTitle">
Built-In Namespace _global_
</h1>
<!-- ============================== class summary ========================== -->
<p class="description">
</p>
<!-- ============================== constructor summary ==================== -->
<!-- ============================== properties summary ===================== -->
<!-- ============================== methods summary ======================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class _global_.">
<caption>Method Summary</caption>
<thead>
<tr>
<th scope="col">Method Attributes</th>
<th scope="col">Method Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#afterEach">afterEach</a></b>(afterEachFunction)
</div>
<div class="description">A function that is called after each spec in a suite.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#beforeEach">beforeEach</a></b>(beforeEachFunction)
</div>
<div class="description">A function that is called before each spec in a suite.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#describe">describe</a></b>(description, specDefinitions)
</div>
<div class="description">Defines a suite of specifications.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#expect">expect</a></b>(actual)
</div>
<div class="description">Starts a chain for a Jasmine expectation.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#it">it</a></b>(desc, func)
</div>
<div class="description">Creates a Jasmine spec that will be added to the current suite.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#runs">runs</a></b>(func)
</div>
<div class="description">Defines part of a jasmine spec.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#spyOn">spyOn</a></b>(obj, methodName)
</div>
<div class="description">Function that installs a spy on an existing object's method name.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#waits">waits</a></b>(timeout)
</div>
<div class="description">Waits for a timeout before moving to the next runs()-defined block.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#waitsFor">waitsFor</a></b>(timeout, latchFunction, message)
</div>
<div class="description">Waits for the latchFunction to return true before proceeding to the next runs()-defined block.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#xdescribe">xdescribe</a></b>(description, specDefinitions)
</div>
<div class="description">Disables a suite of specifications.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#xit">xit</a></b>(desc, func)
</div>
<div class="description">Creates a <em>disabled</em> Jasmine spec.</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== events summary ======================== -->
<!-- ============================== constructor details ==================== -->
<!-- ============================== field details ========================== -->
<!-- ============================== method details ========================= -->
<div class="sectionTitle">
Method Detail
</div>
<a name="afterEach"> </a>
<div class="fixedFont">
<b>afterEach</b>(afterEachFunction)
</div>
<div class="description">
A function that is called after each spec in a suite.
Used for restoring any state that is hijacked during spec execution.
<br />
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{Function}</span> <b>afterEachFunction</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="beforeEach"> </a>
<div class="fixedFont">
<b>beforeEach</b>(beforeEachFunction)
</div>
<div class="description">
A function that is called before each spec in a suite.
Used for spec setup, including validating assumptions.
<br />
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{Function}</span> <b>beforeEachFunction</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="describe"> </a>
<div class="fixedFont">
<b>describe</b>(description, specDefinitions)
</div>
<div class="description">
Defines a suite of specifications.
Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared
are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization
of setup in some tests.
<br />
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
</div>
<pre class="code">// TODO: a simple suite
// TODO: a simple suite with a nested describe block</pre>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{String}</span> <b>description</b>
</dt>
<dd>A string, usually the class under test.</dd>
<dt>
<span class="light fixedFont">{Function}</span> <b>specDefinitions</b>
</dt>
<dd>function that defines several specs.</dd>
</dl>
<hr />
<a name="expect"> </a>
<div class="fixedFont">
<b>expect</b>(actual)
</div>
<div class="description">
Starts a chain for a Jasmine expectation.
It is passed an Object that is the actual value and should chain to one of the many
jasmine.Matchers functions.
<br />
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{Object}</span> <b>actual</b>
</dt>
<dd>Actual value to test against and expected value</dd>
</dl>
<hr />
<a name="it"> </a>
<div class="fixedFont">
<b>it</b>(desc, func)
</div>
<div class="description">
Creates a Jasmine spec that will be added to the current suite.
// TODO: pending tests
<br />
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
</div>
<pre class="code">it('should be true', function() {
expect(true).toEqual(true);
});</pre>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{String}</span> <b>desc</b>
</dt>
<dd>description of this specification</dd>
<dt>
<span class="light fixedFont">{Function}</span> <b>func</b>
</dt>
<dd>defines the preconditions and expectations of the spec</dd>
</dl>
<hr />
<a name="runs"> </a>
<div class="fixedFont">
<b>runs</b>(func)
</div>
<div class="description">
Defines part of a jasmine spec. Used in cominbination with waits or waitsFor in asynchrnous specs.
<br />
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{Function}</span> <b>func</b>
</dt>
<dd>Function that defines part of a jasmine spec.</dd>
</dl>
<hr />
<a name="spyOn"> </a>
<div class="fixedFont">
<b>spyOn</b>(obj, methodName)
</div>
<div class="description">
Function that installs a spy on an existing object's method name. Used within a Spec to create a spy.
<br />
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
</div>
<pre class="code">// spy example
var foo = {
not: function(bool) { return !bool; }
}
spyOn(foo, 'not'); // actual foo.not will not be called, execution stops</pre>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>obj</b>
</dt>
<dd></dd>
<dt>
<b>methodName</b>
</dt>
<dd></dd>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd>a Jasmine spy that can be chained with all spy methods</dd>
</dl>
<dl class="detailList">
<dt class="heading">See:</dt>
<dd><a href="../symbols/jasmine.html#.createSpy">jasmine.createSpy</a></dd>
</dl>
<hr />
<a name="waits"> </a>
<div class="fixedFont">
<b>waits</b>(timeout)
</div>
<div class="description">
Waits for a timeout before moving to the next runs()-defined block.
<br />
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{Number}</span> <b>timeout</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="waitsFor"> </a>
<div class="fixedFont">
<b>waitsFor</b>(timeout, latchFunction, message)
</div>
<div class="description">
Waits for the latchFunction to return true before proceeding to the next runs()-defined block.
<br />
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{Number}</span> <b>timeout</b>
</dt>
<dd></dd>
<dt>
<span class="light fixedFont">{Function}</span> <b>latchFunction</b>
</dt>
<dd></dd>
<dt>
<span class="light fixedFont">{String}</span> <b>message</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="xdescribe"> </a>
<div class="fixedFont">
<b>xdescribe</b>(description, specDefinitions)
</div>
<div class="description">
Disables a suite of specifications. Used to disable some suites in a file, or files, temporarily during development.
<br />
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{String}</span> <b>description</b>
</dt>
<dd>A string, usually the class under test.</dd>
<dt>
<span class="light fixedFont">{Function}</span> <b>specDefinitions</b>
</dt>
<dd>function that defines several specs.</dd>
</dl>
<hr />
<a name="xit"> </a>
<div class="fixedFont">
<b>xit</b>(desc, func)
</div>
<div class="description">
Creates a <em>disabled</em> Jasmine spec.
A convenience method that allows existing specs to be disabled temporarily during development.
<br />
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{String}</span> <b>desc</b>
</dt>
<dd>description of this specification</dd>
<dt>
<span class="light fixedFont">{Function}</span> <b>func</b>
</dt>
<dd>defines the preconditions and expectations of the spec</dd>
</dl>
<!-- ============================== event details ========================= -->
<hr />
</div>
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:21 GMT-0800 (PST)
</div>
</body>
</html>

View File

@ -1,417 +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=utf-8" />
<meta name="generator" content="JsDoc Toolkit" />
<title>JsDoc Reference - jasmine.Block</title>
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<!-- ============================== header ================================= -->
<!-- begin static/header.html -->
<div id="header">
</div>
<!-- end static/header.html -->
<!-- ============================== classes index ============================ -->
<div id="index">
<!-- begin publish.classesIndex -->
<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
<li><a href="../symbols/jasmine.html">jasmine</a></li>
<li><a href="../symbols/jasmine.Block.html">jasmine.Block</a></li>
<li><a href="../symbols/jasmine.Clock.html">jasmine.Clock</a></li>
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
<li><a href="../symbols/jasmine.util.html">jasmine.util</a></li>
</ul>
<hr />
<!-- end publish.classesIndex -->
</div>
<div id="content">
<!-- ============================== class title ============================ -->
<h1 class="classTitle">
Class jasmine.Block
</h1>
<!-- ============================== class summary ========================== -->
<p class="description">
<br /><i>Defined in: </i> <a href="../symbols/src/src_Block.js.html">Block.js</a>.
</p>
<!-- ============================== constructor summary ==================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class jasmine.Block.">
<caption>Class 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">&nbsp;</td>
<td class="nameDescription" >
<div class="fixedFont">
<b><a href="../symbols/jasmine.Block.html">jasmine.Block</a></b>(env, func, spec)
</div>
<div class="description">Blocks are functions with executable code that make up a spec.</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== properties summary ===================== -->
<!-- ============================== methods summary ======================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class jasmine.Block.">
<caption>Method Summary</caption>
<thead>
<tr>
<th scope="col">Method Attributes</th>
<th scope="col">Method Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Block.html#execute">execute</a></b>(onComplete)
</div>
<div class="description"></div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== events summary ======================== -->
<!-- ============================== constructor details ==================== -->
<div class="details"><a name="constructor"> </a>
<div class="sectionTitle">
Class Detail
</div>
<div class="fixedFont">
<b>jasmine.Block</b>(env, func, spec)
</div>
<div class="description">
Blocks are functions with executable code that make up a spec.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{<a href="../symbols/jasmine.Env.html">jasmine.Env</a>}</span> <b>env</b>
</dt>
<dd></dd>
<dt>
<span class="light fixedFont">{Function}</span> <b>func</b>
</dt>
<dd></dd>
<dt>
<span class="light fixedFont">{<a href="../symbols/jasmine.Spec.html">jasmine.Spec</a>}</span> <b>spec</b>
</dt>
<dd></dd>
</dl>
</div>
<!-- ============================== field details ========================== -->
<!-- ============================== method details ========================= -->
<div class="sectionTitle">
Method Detail
</div>
<a name="execute"> </a>
<div class="fixedFont">
<b>execute</b>(onComplete)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>onComplete</b>
</dt>
<dd></dd>
</dl>
<!-- ============================== event details ========================= -->
<hr />
</div>
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:22 GMT-0800 (PST)
</div>
</body>
</html>

View File

@ -1,678 +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=utf-8" />
<meta name="generator" content="JsDoc Toolkit" />
<title>JsDoc Reference - jasmine.Clock</title>
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<!-- ============================== header ================================= -->
<!-- begin static/header.html -->
<div id="header">
</div>
<!-- end static/header.html -->
<!-- ============================== classes index ============================ -->
<div id="index">
<!-- begin publish.classesIndex -->
<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
<li><a href="../symbols/jasmine.html">jasmine</a></li>
<li><a href="../symbols/jasmine.Block.html">jasmine.Block</a></li>
<li><a href="../symbols/jasmine.Clock.html">jasmine.Clock</a></li>
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
<li><a href="../symbols/jasmine.util.html">jasmine.util</a></li>
</ul>
<hr />
<!-- end publish.classesIndex -->
</div>
<div id="content">
<!-- ============================== class title ============================ -->
<h1 class="classTitle">
Namespace jasmine.Clock
</h1>
<!-- ============================== class summary ========================== -->
<p class="description">
<br /><i>Defined in: </i> <a href="../symbols/src/src_mock-timeout.js.html">mock-timeout.js</a>.
</p>
<!-- ============================== constructor summary ==================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class jasmine.Clock.">
<caption>Namespace 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">&nbsp;</td>
<td class="nameDescription" >
<div class="fixedFont">
<b><a href="../symbols/jasmine.Clock.html">jasmine.Clock</a></b>
</div>
<div class="description"></div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== properties summary ===================== -->
<!-- ============================== methods summary ======================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class jasmine.Clock.">
<caption>Method Summary</caption>
<thead>
<tr>
<th scope="col">Method Attributes</th>
<th scope="col">Method Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&lt;static&gt; &nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">jasmine.Clock.<b><a href="../symbols/jasmine.Clock.html#.assertInstalled">assertInstalled</a></b>()
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&lt;static&gt; &nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">jasmine.Clock.<b><a href="../symbols/jasmine.Clock.html#.installMock">installMock</a></b>()
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&lt;static&gt; &nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">jasmine.Clock.<b><a href="../symbols/jasmine.Clock.html#.reset">reset</a></b>()
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&lt;static&gt; &nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">jasmine.Clock.<b><a href="../symbols/jasmine.Clock.html#.runFunctionsWithinRange">runFunctionsWithinRange</a></b>(oldMillis, nowMillis)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&lt;static&gt; &nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">jasmine.Clock.<b><a href="../symbols/jasmine.Clock.html#.scheduleFunction">scheduleFunction</a></b>(timeoutKey, funcToCall, millis, recurring)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&lt;static&gt; &nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">jasmine.Clock.<b><a href="../symbols/jasmine.Clock.html#.tick">tick</a></b>(millis)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&lt;static&gt; &nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">jasmine.Clock.<b><a href="../symbols/jasmine.Clock.html#.uninstallMock">uninstallMock</a></b>()
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&lt;static&gt; &nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">jasmine.Clock.<b><a href="../symbols/jasmine.Clock.html#.useMock">useMock</a></b>()
</div>
<div class="description"></div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== events summary ======================== -->
<!-- ============================== constructor details ==================== -->
<div class="details"><a name="constructor"> </a>
<div class="sectionTitle">
Namespace Detail
</div>
<div class="fixedFont">
<b>jasmine.Clock</b>
</div>
<div class="description">
</div>
</div>
<!-- ============================== field details ========================== -->
<!-- ============================== method details ========================= -->
<div class="sectionTitle">
Method Detail
</div>
<a name=".assertInstalled"> </a>
<div class="fixedFont">&lt;static&gt;
<span class="light">jasmine.Clock.</span><b>assertInstalled</b>()
</div>
<div class="description">
</div>
<hr />
<a name=".installMock"> </a>
<div class="fixedFont">&lt;static&gt;
<span class="light">jasmine.Clock.</span><b>installMock</b>()
</div>
<div class="description">
</div>
<hr />
<a name=".reset"> </a>
<div class="fixedFont">&lt;static&gt;
<span class="light">jasmine.Clock.</span><b>reset</b>()
</div>
<div class="description">
</div>
<hr />
<a name=".runFunctionsWithinRange"> </a>
<div class="fixedFont">&lt;static&gt;
<span class="light">jasmine.Clock.</span><b>runFunctionsWithinRange</b>(oldMillis, nowMillis)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>oldMillis</b>
</dt>
<dd></dd>
<dt>
<b>nowMillis</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name=".scheduleFunction"> </a>
<div class="fixedFont">&lt;static&gt;
<span class="light">jasmine.Clock.</span><b>scheduleFunction</b>(timeoutKey, funcToCall, millis, recurring)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>timeoutKey</b>
</dt>
<dd></dd>
<dt>
<b>funcToCall</b>
</dt>
<dd></dd>
<dt>
<b>millis</b>
</dt>
<dd></dd>
<dt>
<b>recurring</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name=".tick"> </a>
<div class="fixedFont">&lt;static&gt;
<span class="light">jasmine.Clock.</span><b>tick</b>(millis)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>millis</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name=".uninstallMock"> </a>
<div class="fixedFont">&lt;static&gt;
<span class="light">jasmine.Clock.</span><b>uninstallMock</b>()
</div>
<div class="description">
</div>
<hr />
<a name=".useMock"> </a>
<div class="fixedFont">&lt;static&gt;
<span class="light">jasmine.Clock.</span><b>useMock</b>()
</div>
<div class="description">
</div>
<!-- ============================== event details ========================= -->
<hr />
</div>
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:22 GMT-0800 (PST)
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -1,822 +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=utf-8" />
<meta name="generator" content="JsDoc Toolkit" />
<title>JsDoc Reference - jasmine.JsApiReporter</title>
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<!-- ============================== header ================================= -->
<!-- begin static/header.html -->
<div id="header">
</div>
<!-- end static/header.html -->
<!-- ============================== classes index ============================ -->
<div id="index">
<!-- begin publish.classesIndex -->
<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
<li><a href="../symbols/jasmine.html">jasmine</a></li>
<li><a href="../symbols/jasmine.Block.html">jasmine.Block</a></li>
<li><a href="../symbols/jasmine.Clock.html">jasmine.Clock</a></li>
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
<li><a href="../symbols/jasmine.util.html">jasmine.util</a></li>
</ul>
<hr />
<!-- end publish.classesIndex -->
</div>
<div id="content">
<!-- ============================== class title ============================ -->
<h1 class="classTitle">
Class jasmine.JsApiReporter
</h1>
<!-- ============================== class summary ========================== -->
<p class="description">
<br /><i>Defined in: </i> <a href="../symbols/src/src_JsApiReporter.js.html">JsApiReporter.js</a>.
</p>
<!-- ============================== constructor summary ==================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class jasmine.JsApiReporter.">
<caption>Class 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">&nbsp;</td>
<td class="nameDescription" >
<div class="fixedFont">
<b><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></b>()
</div>
<div class="description">JavaScript API reporter.</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== properties summary ===================== -->
<!-- ============================== methods summary ======================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class jasmine.JsApiReporter.">
<caption>Method Summary</caption>
<thead>
<tr>
<th scope="col">Method Attributes</th>
<th scope="col">Method Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.JsApiReporter.html#log">log</a></b>(str)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.JsApiReporter.html#reportRunnerResults">reportRunnerResults</a></b>(runner)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.JsApiReporter.html#reportRunnerStarting">reportRunnerStarting</a></b>(runner)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.JsApiReporter.html#reportSpecResults">reportSpecResults</a></b>(spec)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.JsApiReporter.html#reportSuiteResults">reportSuiteResults</a></b>(suite)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.JsApiReporter.html#results">results</a></b>()
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.JsApiReporter.html#resultsForSpec">resultsForSpec</a></b>(specId)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.JsApiReporter.html#resultsForSpecs">resultsForSpecs</a></b>(specIds)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.JsApiReporter.html#suites">suites</a></b>()
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.JsApiReporter.html#summarize_">summarize_</a></b>(suiteOrSpec)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.JsApiReporter.html#summarizeResult_">summarizeResult_</a></b>(result)
</div>
<div class="description"></div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== events summary ======================== -->
<!-- ============================== constructor details ==================== -->
<div class="details"><a name="constructor"> </a>
<div class="sectionTitle">
Class Detail
</div>
<div class="fixedFont">
<b>jasmine.JsApiReporter</b>()
</div>
<div class="description">
JavaScript API reporter.
</div>
</div>
<!-- ============================== field details ========================== -->
<!-- ============================== method details ========================= -->
<div class="sectionTitle">
Method Detail
</div>
<a name="log"> </a>
<div class="fixedFont">
<b>log</b>(str)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>str</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="reportRunnerResults"> </a>
<div class="fixedFont">
<b>reportRunnerResults</b>(runner)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>runner</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="reportRunnerStarting"> </a>
<div class="fixedFont">
<b>reportRunnerStarting</b>(runner)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>runner</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="reportSpecResults"> </a>
<div class="fixedFont">
<b>reportSpecResults</b>(spec)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>spec</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="reportSuiteResults"> </a>
<div class="fixedFont">
<b>reportSuiteResults</b>(suite)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>suite</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="results"> </a>
<div class="fixedFont">
<b>results</b>()
</div>
<div class="description">
</div>
<hr />
<a name="resultsForSpec"> </a>
<div class="fixedFont">
<b>resultsForSpec</b>(specId)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>specId</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="resultsForSpecs"> </a>
<div class="fixedFont">
<b>resultsForSpecs</b>(specIds)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>specIds</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="suites"> </a>
<div class="fixedFont">
<b>suites</b>()
</div>
<div class="description">
</div>
<hr />
<a name="summarize_"> </a>
<div class="fixedFont">
<b>summarize_</b>(suiteOrSpec)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>suiteOrSpec</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="summarizeResult_"> </a>
<div class="fixedFont">
<b>summarizeResult_</b>(result)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>result</b>
</dt>
<dd></dd>
</dl>
<!-- ============================== event details ========================= -->
<hr />
</div>
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:22 GMT-0800 (PST)
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -1,394 +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=utf-8" />
<meta name="generator" content="JsDoc Toolkit" />
<title>JsDoc Reference - jasmine.MultiReporter</title>
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<!-- ============================== header ================================= -->
<!-- begin static/header.html -->
<div id="header">
</div>
<!-- end static/header.html -->
<!-- ============================== classes index ============================ -->
<div id="index">
<!-- begin publish.classesIndex -->
<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
<li><a href="../symbols/jasmine.html">jasmine</a></li>
<li><a href="../symbols/jasmine.Block.html">jasmine.Block</a></li>
<li><a href="../symbols/jasmine.Clock.html">jasmine.Clock</a></li>
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
<li><a href="../symbols/jasmine.util.html">jasmine.util</a></li>
</ul>
<hr />
<!-- end publish.classesIndex -->
</div>
<div id="content">
<!-- ============================== class title ============================ -->
<h1 class="classTitle">
Class jasmine.MultiReporter
</h1>
<!-- ============================== class summary ========================== -->
<p class="description">
<br /><i>Defined in: </i> <a href="../symbols/src/src_MultiReporter.js.html">MultiReporter.js</a>.
</p>
<!-- ============================== constructor summary ==================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class jasmine.MultiReporter.">
<caption>Class 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">&nbsp;</td>
<td class="nameDescription" >
<div class="fixedFont">
<b><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></b>()
</div>
<div class="description"></div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== properties summary ===================== -->
<!-- ============================== methods summary ======================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class jasmine.MultiReporter.">
<caption>Method Summary</caption>
<thead>
<tr>
<th scope="col">Method Attributes</th>
<th scope="col">Method Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.MultiReporter.html#addReporter">addReporter</a></b>(reporter)
</div>
<div class="description"></div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== events summary ======================== -->
<!-- ============================== constructor details ==================== -->
<div class="details"><a name="constructor"> </a>
<div class="sectionTitle">
Class Detail
</div>
<div class="fixedFont">
<b>jasmine.MultiReporter</b>()
</div>
<div class="description">
</div>
</div>
<!-- ============================== field details ========================== -->
<!-- ============================== method details ========================= -->
<div class="sectionTitle">
Method Detail
</div>
<a name="addReporter"> </a>
<div class="fixedFont">
<b>addReporter</b>(reporter)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>reporter</b>
</dt>
<dd></dd>
</dl>
<!-- ============================== event details ========================= -->
<hr />
</div>
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:22 GMT-0800 (PST)
</div>
</body>
</html>

View File

@ -1,710 +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=utf-8" />
<meta name="generator" content="JsDoc Toolkit" />
<title>JsDoc Reference - jasmine.NestedResults</title>
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<!-- ============================== header ================================= -->
<!-- begin static/header.html -->
<div id="header">
</div>
<!-- end static/header.html -->
<!-- ============================== classes index ============================ -->
<div id="index">
<!-- begin publish.classesIndex -->
<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
<li><a href="../symbols/jasmine.html">jasmine</a></li>
<li><a href="../symbols/jasmine.Block.html">jasmine.Block</a></li>
<li><a href="../symbols/jasmine.Clock.html">jasmine.Clock</a></li>
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
<li><a href="../symbols/jasmine.util.html">jasmine.util</a></li>
</ul>
<hr />
<!-- end publish.classesIndex -->
</div>
<div id="content">
<!-- ============================== class title ============================ -->
<h1 class="classTitle">
Class jasmine.NestedResults
</h1>
<!-- ============================== class summary ========================== -->
<p class="description">
<br /><i>Defined in: </i> <a href="../symbols/src/src_NestedResults.js.html">NestedResults.js</a>.
</p>
<!-- ============================== constructor summary ==================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class jasmine.NestedResults.">
<caption>Class 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">&nbsp;</td>
<td class="nameDescription" >
<div class="fixedFont">
<b><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></b>()
</div>
<div class="description">Holds results for a set of Jasmine spec.</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== properties summary ===================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class jasmine.NestedResults.">
<caption>Field Summary</caption>
<thead>
<tr>
<th scope="col">Field Attributes</th>
<th scope="col">Field Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.NestedResults.html#failedCount">failedCount</a></b>
</div>
<div class="description">Number of failed results</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.NestedResults.html#passedCount">passedCount</a></b>
</div>
<div class="description">Number of passed results</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.NestedResults.html#skipped">skipped</a></b>
</div>
<div class="description">Was this suite/spec skipped?</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.NestedResults.html#totalCount">totalCount</a></b>
</div>
<div class="description">The total count of results</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== methods summary ======================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class jasmine.NestedResults.">
<caption>Method Summary</caption>
<thead>
<tr>
<th scope="col">Method Attributes</th>
<th scope="col">Method Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.NestedResults.html#addResult">addResult</a></b>(result)
</div>
<div class="description">Adds a result, tracking counts (total, passed, & failed)</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.NestedResults.html#getItems">getItems</a></b>()
</div>
<div class="description">Getter for the results: message & results.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.NestedResults.html#log">log</a></b>(message)
</div>
<div class="description">Tracks a result's message.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.NestedResults.html#passed">passed</a></b>()
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.NestedResults.html#rollupCounts">rollupCounts</a></b>(result)
</div>
<div class="description">Roll up the result counts.</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== events summary ======================== -->
<!-- ============================== constructor details ==================== -->
<div class="details"><a name="constructor"> </a>
<div class="sectionTitle">
Class Detail
</div>
<div class="fixedFont">
<b>jasmine.NestedResults</b>()
</div>
<div class="description">
Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults
</div>
</div>
<!-- ============================== field details ========================== -->
<div class="sectionTitle">
Field Detail
</div>
<a name="failedCount"> </a>
<div class="fixedFont">
<b>failedCount</b>
</div>
<div class="description">
Number of failed results
</div>
<hr />
<a name="passedCount"> </a>
<div class="fixedFont">
<b>passedCount</b>
</div>
<div class="description">
Number of passed results
</div>
<hr />
<a name="skipped"> </a>
<div class="fixedFont">
<b>skipped</b>
</div>
<div class="description">
Was this suite/spec skipped?
</div>
<hr />
<a name="totalCount"> </a>
<div class="fixedFont">
<b>totalCount</b>
</div>
<div class="description">
The total count of results
</div>
<!-- ============================== method details ========================= -->
<div class="sectionTitle">
Method Detail
</div>
<a name="addResult"> </a>
<div class="fixedFont">
<b>addResult</b>(result)
</div>
<div class="description">
Adds a result, tracking counts (total, passed, & failed)
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{<a href="../symbols/jasmine.html#.ExpectationResult">jasmine.ExpectationResult</a>|<a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a>}</span> <b>result</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="getItems"> </a>
<div class="fixedFont">
<b>getItems</b>()
</div>
<div class="description">
Getter for the results: message & results.
</div>
<hr />
<a name="log"> </a>
<div class="fixedFont">
<b>log</b>(message)
</div>
<div class="description">
Tracks a result's message.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>message</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="passed"> </a>
<div class="fixedFont">
<span class="light">{Boolean}</span>
<b>passed</b>()
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{Boolean}</span> True if <b>everything</b> below passed</dd>
</dl>
<hr />
<a name="rollupCounts"> </a>
<div class="fixedFont">
<b>rollupCounts</b>(result)
</div>
<div class="description">
Roll up the result counts.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>result</b>
</dt>
<dd></dd>
</dl>
<!-- ============================== event details ========================= -->
<hr />
</div>
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:22 GMT-0800 (PST)
</div>
</body>
</html>

View File

@ -1,574 +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=utf-8" />
<meta name="generator" content="JsDoc Toolkit" />
<title>JsDoc Reference - jasmine.Reporter</title>
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<!-- ============================== header ================================= -->
<!-- begin static/header.html -->
<div id="header">
</div>
<!-- end static/header.html -->
<!-- ============================== classes index ============================ -->
<div id="index">
<!-- begin publish.classesIndex -->
<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
<li><a href="../symbols/jasmine.html">jasmine</a></li>
<li><a href="../symbols/jasmine.Block.html">jasmine.Block</a></li>
<li><a href="../symbols/jasmine.Clock.html">jasmine.Clock</a></li>
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
<li><a href="../symbols/jasmine.util.html">jasmine.util</a></li>
</ul>
<hr />
<!-- end publish.classesIndex -->
</div>
<div id="content">
<!-- ============================== class title ============================ -->
<h1 class="classTitle">
Class jasmine.Reporter
</h1>
<!-- ============================== class summary ========================== -->
<p class="description">
<br /><i>Defined in: </i> <a href="../symbols/src/src_Reporter.js.html">Reporter.js</a>.
</p>
<!-- ============================== constructor summary ==================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class jasmine.Reporter.">
<caption>Class 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">&nbsp;</td>
<td class="nameDescription" >
<div class="fixedFont">
<b><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></b>()
</div>
<div class="description">No-op base class for Jasmine reporters.</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== properties summary ===================== -->
<!-- ============================== methods summary ======================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class jasmine.Reporter.">
<caption>Method Summary</caption>
<thead>
<tr>
<th scope="col">Method Attributes</th>
<th scope="col">Method Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Reporter.html#log">log</a></b>(str)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Reporter.html#reportRunnerResults">reportRunnerResults</a></b>(runner)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Reporter.html#reportRunnerStarting">reportRunnerStarting</a></b>(runner)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Reporter.html#reportSpecResults">reportSpecResults</a></b>(spec)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Reporter.html#reportSuiteResults">reportSuiteResults</a></b>(suite)
</div>
<div class="description"></div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== events summary ======================== -->
<!-- ============================== constructor details ==================== -->
<div class="details"><a name="constructor"> </a>
<div class="sectionTitle">
Class Detail
</div>
<div class="fixedFont">
<b>jasmine.Reporter</b>()
</div>
<div class="description">
No-op base class for Jasmine reporters.
</div>
</div>
<!-- ============================== field details ========================== -->
<!-- ============================== method details ========================= -->
<div class="sectionTitle">
Method Detail
</div>
<a name="log"> </a>
<div class="fixedFont">
<b>log</b>(str)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>str</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="reportRunnerResults"> </a>
<div class="fixedFont">
<b>reportRunnerResults</b>(runner)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>runner</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="reportRunnerStarting"> </a>
<div class="fixedFont">
<b>reportRunnerStarting</b>(runner)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>runner</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="reportSpecResults"> </a>
<div class="fixedFont">
<b>reportSpecResults</b>(spec)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>spec</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="reportSuiteResults"> </a>
<div class="fixedFont">
<b>reportSuiteResults</b>(suite)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>suite</b>
</dt>
<dd></dd>
</dl>
<!-- ============================== event details ========================= -->
<hr />
</div>
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:22 GMT-0800 (PST)
</div>
</body>
</html>

View File

@ -1,710 +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=utf-8" />
<meta name="generator" content="JsDoc Toolkit" />
<title>JsDoc Reference - jasmine.Runner</title>
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<!-- ============================== header ================================= -->
<!-- begin static/header.html -->
<div id="header">
</div>
<!-- end static/header.html -->
<!-- ============================== classes index ============================ -->
<div id="index">
<!-- begin publish.classesIndex -->
<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
<li><a href="../symbols/jasmine.html">jasmine</a></li>
<li><a href="../symbols/jasmine.Block.html">jasmine.Block</a></li>
<li><a href="../symbols/jasmine.Clock.html">jasmine.Clock</a></li>
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
<li><a href="../symbols/jasmine.util.html">jasmine.util</a></li>
</ul>
<hr />
<!-- end publish.classesIndex -->
</div>
<div id="content">
<!-- ============================== class title ============================ -->
<h1 class="classTitle">
Class jasmine.Runner
</h1>
<!-- ============================== class summary ========================== -->
<p class="description">
<br /><i>Defined in: </i> <a href="../symbols/src/src_Runner.js.html">Runner.js</a>.
</p>
<!-- ============================== constructor summary ==================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class jasmine.Runner.">
<caption>Class 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">&nbsp;</td>
<td class="nameDescription" >
<div class="fixedFont">
<b><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></b>(env)
</div>
<div class="description">Runner</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== properties summary ===================== -->
<!-- ============================== methods summary ======================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class jasmine.Runner.">
<caption>Method Summary</caption>
<thead>
<tr>
<th scope="col">Method Attributes</th>
<th scope="col">Method Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Runner.html#add">add</a></b>(block)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Runner.html#addSuite">addSuite</a></b>(suite)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Runner.html#afterEach">afterEach</a></b>(afterEachFunction)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Runner.html#beforeEach">beforeEach</a></b>(beforeEachFunction)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Runner.html#execute">execute</a></b>()
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Runner.html#finishCallback">finishCallback</a></b>()
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Runner.html#results">results</a></b>()
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Runner.html#specs">specs</a></b>()
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Runner.html#suites">suites</a></b>()
</div>
<div class="description"></div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== events summary ======================== -->
<!-- ============================== constructor details ==================== -->
<div class="details"><a name="constructor"> </a>
<div class="sectionTitle">
Class Detail
</div>
<div class="fixedFont">
<b>jasmine.Runner</b>(env)
</div>
<div class="description">
Runner
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{<a href="../symbols/jasmine.Env.html">jasmine.Env</a>}</span> <b>env</b>
</dt>
<dd></dd>
</dl>
</div>
<!-- ============================== field details ========================== -->
<!-- ============================== method details ========================= -->
<div class="sectionTitle">
Method Detail
</div>
<a name="add"> </a>
<div class="fixedFont">
<b>add</b>(block)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>block</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="addSuite"> </a>
<div class="fixedFont">
<b>addSuite</b>(suite)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>suite</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="afterEach"> </a>
<div class="fixedFont">
<b>afterEach</b>(afterEachFunction)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>afterEachFunction</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="beforeEach"> </a>
<div class="fixedFont">
<b>beforeEach</b>(beforeEachFunction)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>beforeEachFunction</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="execute"> </a>
<div class="fixedFont">
<b>execute</b>()
</div>
<div class="description">
</div>
<hr />
<a name="finishCallback"> </a>
<div class="fixedFont">
<b>finishCallback</b>()
</div>
<div class="description">
</div>
<hr />
<a name="results"> </a>
<div class="fixedFont">
<b>results</b>()
</div>
<div class="description">
</div>
<hr />
<a name="specs"> </a>
<div class="fixedFont">
<b>specs</b>()
</div>
<div class="description">
</div>
<hr />
<a name="suites"> </a>
<div class="fixedFont">
<b>suites</b>()
</div>
<div class="description">
</div>
<!-- ============================== event details ========================= -->
<hr />
</div>
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:22 GMT-0800 (PST)
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -1,855 +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=utf-8" />
<meta name="generator" content="JsDoc Toolkit" />
<title>JsDoc Reference - jasmine.Spy</title>
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<!-- ============================== header ================================= -->
<!-- begin static/header.html -->
<div id="header">
</div>
<!-- end static/header.html -->
<!-- ============================== classes index ============================ -->
<div id="index">
<!-- begin publish.classesIndex -->
<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
<li><a href="../symbols/jasmine.html">jasmine</a></li>
<li><a href="../symbols/jasmine.Block.html">jasmine.Block</a></li>
<li><a href="../symbols/jasmine.Clock.html">jasmine.Clock</a></li>
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
<li><a href="../symbols/jasmine.util.html">jasmine.util</a></li>
</ul>
<hr />
<!-- end publish.classesIndex -->
</div>
<div id="content">
<!-- ============================== class title ============================ -->
<h1 class="classTitle">
Class jasmine.Spy
</h1>
<!-- ============================== class summary ========================== -->
<p class="description">
<br /><i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
</p>
<!-- ============================== constructor summary ==================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class jasmine.Spy.">
<caption>Class 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">&nbsp;</td>
<td class="nameDescription" >
<div class="fixedFont">
<b><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></b>(name)
</div>
<div class="description">Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks.</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== properties summary ===================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class jasmine.Spy.">
<caption>Field Summary</caption>
<thead>
<tr>
<th scope="col">Field Attributes</th>
<th scope="col">Field Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Spy.html#argsForCall">argsForCall</a></b>
</div>
<div class="description">Holds arguments for each call to the spy, indexed by call count</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Spy.html#identity">identity</a></b>
</div>
<div class="description">The name of the spy, if provided.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Spy.html#isSpy">isSpy</a></b>
</div>
<div class="description">Is this Object a spy?</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Spy.html#mostRecentCall">mostRecentCall</a></b>
</div>
<div class="description">Tracking of the most recent call to the spy.</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== methods summary ======================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class jasmine.Spy.">
<caption>Method Summary</caption>
<thead>
<tr>
<th scope="col">Method Attributes</th>
<th scope="col">Method Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Spy.html#andCallFake">andCallFake</a></b>(fakeFunc)
</div>
<div class="description">Calls an alternate implementation when a spy is called.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Spy.html#andCallThrough">andCallThrough</a></b>()
</div>
<div class="description">Tells a spy to call through to the actual implemenatation.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Spy.html#andReturn">andReturn</a></b>(value)
</div>
<div class="description">For setting the return value of a spy.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Spy.html#andThrow">andThrow</a></b>(exceptionMsg)
</div>
<div class="description">For throwing an exception when a spy is called.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Spy.html#plan">plan</a></b>()
</div>
<div class="description">The actual function this spy stubs.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Spy.html#reset">reset</a></b>()
</div>
<div class="description">Resets all of a spy's the tracking variables so that it can be used again.</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== events summary ======================== -->
<!-- ============================== constructor details ==================== -->
<div class="details"><a name="constructor"> </a>
<div class="sectionTitle">
Class Detail
</div>
<div class="fixedFont">
<b>jasmine.Spy</b>(name)
</div>
<div class="description">
Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks.
Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmine
expectation syntax. Spies can be checked if they were called or not and what the calling params were.
A Spy has the following mehtod: wasCalled, callCount, mostRecentCall, and argsForCall (see docs)
Spies are torn down at the end of every spec.
Note: Do <b>not</b> call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj.
</div>
<pre class="code">// a stub
var myStub = jasmine.createSpy('myStub'); // can be used anywhere
// spy example
var foo = {
not: function(bool) { return !bool; }
}
// actual foo.not will not be called, execution stops
spyOn(foo, 'not');
// foo.not spied upon, execution will continue to implementation
spyOn(foo, 'not').andCallThrough();
// fake example
var foo = {
not: function(bool) { return !bool; }
}
// foo.not(val) will return val
spyOn(foo, 'not').andCallFake(function(value) {return value;});
// mock example
foo.not(7 == 7);
expect(foo.not).wasCalled();
expect(foo.not).wasCalledWith(true);</pre>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{String}</span> <b>name</b>
</dt>
<dd></dd>
</dl>
<dl class="detailList">
<dt class="heading">See:</dt>
<dd><a href="../symbols/_global_.html#spyOn">spyOn</a>, jasmine.createSpy, jasmine.createSpyObj</dd>
</dl>
</div>
<!-- ============================== field details ========================== -->
<div class="sectionTitle">
Field Detail
</div>
<a name="argsForCall"> </a>
<div class="fixedFont">
<b>argsForCall</b>
</div>
<div class="description">
Holds arguments for each call to the spy, indexed by call count
</div>
<pre class="code">var mySpy = jasmine.createSpy('foo');
mySpy(1, 2);
mySpy(7, 8);
mySpy.mostRecentCall.args = [7, 8];
mySpy.argsForCall[0] = [1, 2];
mySpy.argsForCall[1] = [7, 8];</pre>
<hr />
<a name="identity"> </a>
<div class="fixedFont">
<b>identity</b>
</div>
<div class="description">
The name of the spy, if provided.
</div>
<hr />
<a name="isSpy"> </a>
<div class="fixedFont">
<b>isSpy</b>
</div>
<div class="description">
Is this Object a spy?
</div>
<hr />
<a name="mostRecentCall"> </a>
<div class="fixedFont">
<b>mostRecentCall</b>
</div>
<div class="description">
Tracking of the most recent call to the spy.
</div>
<pre class="code">var mySpy = jasmine.createSpy('foo');
mySpy(1, 2);
mySpy.mostRecentCall.args = [1, 2];</pre>
<!-- ============================== method details ========================= -->
<div class="sectionTitle">
Method Detail
</div>
<a name="andCallFake"> </a>
<div class="fixedFont">
<b>andCallFake</b>(fakeFunc)
</div>
<div class="description">
Calls an alternate implementation when a spy is called.
</div>
<pre class="code">var baz = function() {
// do some stuff, return something
}
// defining a spy from scratch: foo() calls the function baz
var foo = jasmine.createSpy('spy on foo').andCall(baz);
// defining a spy on an existing property: foo.bar() calls an anonymnous function
spyOn(foo, 'bar').andCall(function() { return 'baz';} );</pre>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{Function}</span> <b>fakeFunc</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="andCallThrough"> </a>
<div class="fixedFont">
<b>andCallThrough</b>()
</div>
<div class="description">
Tells a spy to call through to the actual implemenatation.
</div>
<pre class="code">var foo = {
bar: function() { // do some stuff }
}
// defining a spy on an existing property: foo.bar
spyOn(foo, 'bar').andCallThrough();</pre>
<hr />
<a name="andReturn"> </a>
<div class="fixedFont">
<b>andReturn</b>(value)
</div>
<div class="description">
For setting the return value of a spy.
</div>
<pre class="code">// defining a spy from scratch: foo() returns 'baz'
var foo = jasmine.createSpy('spy on foo').andReturn('baz');
// defining a spy on an existing property: foo.bar() returns 'baz'
spyOn(foo, 'bar').andReturn('baz');</pre>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{Object}</span> <b>value</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="andThrow"> </a>
<div class="fixedFont">
<b>andThrow</b>(exceptionMsg)
</div>
<div class="description">
For throwing an exception when a spy is called.
</div>
<pre class="code">// defining a spy from scratch: foo() throws an exception w/ message 'ouch'
var foo = jasmine.createSpy('spy on foo').andThrow('baz');
// defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch'
spyOn(foo, 'bar').andThrow('baz');</pre>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{String}</span> <b>exceptionMsg</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="plan"> </a>
<div class="fixedFont">
<b>plan</b>()
</div>
<div class="description">
The actual function this spy stubs.
</div>
<hr />
<a name="reset"> </a>
<div class="fixedFont">
<b>reset</b>()
</div>
<div class="description">
Resets all of a spy's the tracking variables so that it can be used again.
</div>
<pre class="code">spyOn(foo, 'bar');
foo.bar();
expect(foo.bar.callCount).toEqual(1);
foo.bar.reset();
expect(foo.bar.callCount).toEqual(0);</pre>
<!-- ============================== event details ========================= -->
<hr />
</div>
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:22 GMT-0800 (PST)
</div>
</body>
</html>

View File

@ -1,705 +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=utf-8" />
<meta name="generator" content="JsDoc Toolkit" />
<title>JsDoc Reference - jasmine.Suite</title>
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<!-- ============================== header ================================= -->
<!-- begin static/header.html -->
<div id="header">
</div>
<!-- end static/header.html -->
<!-- ============================== classes index ============================ -->
<div id="index">
<!-- begin publish.classesIndex -->
<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
<li><a href="../symbols/jasmine.html">jasmine</a></li>
<li><a href="../symbols/jasmine.Block.html">jasmine.Block</a></li>
<li><a href="../symbols/jasmine.Clock.html">jasmine.Clock</a></li>
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
<li><a href="../symbols/jasmine.util.html">jasmine.util</a></li>
</ul>
<hr />
<!-- end publish.classesIndex -->
</div>
<div id="content">
<!-- ============================== class title ============================ -->
<h1 class="classTitle">
Class jasmine.Suite
</h1>
<!-- ============================== class summary ========================== -->
<p class="description">
<br /><i>Defined in: </i> <a href="../symbols/src/src_Suite.js.html">Suite.js</a>.
</p>
<!-- ============================== constructor summary ==================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class jasmine.Suite.">
<caption>Class 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">&nbsp;</td>
<td class="nameDescription" >
<div class="fixedFont">
<b><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></b>(env, description, specDefinitions, parentSuite)
</div>
<div class="description">Internal representation of a Jasmine suite.</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== properties summary ===================== -->
<!-- ============================== methods summary ======================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class jasmine.Suite.">
<caption>Method Summary</caption>
<thead>
<tr>
<th scope="col">Method Attributes</th>
<th scope="col">Method Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Suite.html#add">add</a></b>(block)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Suite.html#afterEach">afterEach</a></b>(afterEachFunction)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Suite.html#beforeEach">beforeEach</a></b>(beforeEachFunction)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Suite.html#execute">execute</a></b>(onComplete)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Suite.html#finish">finish</a></b>(onComplete)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Suite.html#getFullName">getFullName</a></b>()
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Suite.html#results">results</a></b>()
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Suite.html#specs">specs</a></b>()
</div>
<div class="description"></div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== events summary ======================== -->
<!-- ============================== constructor details ==================== -->
<div class="details"><a name="constructor"> </a>
<div class="sectionTitle">
Class Detail
</div>
<div class="fixedFont">
<b>jasmine.Suite</b>(env, description, specDefinitions, parentSuite)
</div>
<div class="description">
Internal representation of a Jasmine suite.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{<a href="../symbols/jasmine.Env.html">jasmine.Env</a>}</span> <b>env</b>
</dt>
<dd></dd>
<dt>
<span class="light fixedFont">{String}</span> <b>description</b>
</dt>
<dd></dd>
<dt>
<span class="light fixedFont">{Function}</span> <b>specDefinitions</b>
</dt>
<dd></dd>
<dt>
<span class="light fixedFont">{<a href="../symbols/jasmine.Suite.html">jasmine.Suite</a>}</span> <b>parentSuite</b>
</dt>
<dd></dd>
</dl>
</div>
<!-- ============================== field details ========================== -->
<!-- ============================== method details ========================= -->
<div class="sectionTitle">
Method Detail
</div>
<a name="add"> </a>
<div class="fixedFont">
<b>add</b>(block)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>block</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="afterEach"> </a>
<div class="fixedFont">
<b>afterEach</b>(afterEachFunction)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>afterEachFunction</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="beforeEach"> </a>
<div class="fixedFont">
<b>beforeEach</b>(beforeEachFunction)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>beforeEachFunction</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="execute"> </a>
<div class="fixedFont">
<b>execute</b>(onComplete)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>onComplete</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="finish"> </a>
<div class="fixedFont">
<b>finish</b>(onComplete)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>onComplete</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="getFullName"> </a>
<div class="fixedFont">
<b>getFullName</b>()
</div>
<div class="description">
</div>
<hr />
<a name="results"> </a>
<div class="fixedFont">
<b>results</b>()
</div>
<div class="description">
</div>
<hr />
<a name="specs"> </a>
<div class="fixedFont">
<b>specs</b>()
</div>
<div class="description">
</div>
<!-- ============================== event details ========================= -->
<hr />
</div>
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:22 GMT-0800 (PST)
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -1,535 +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=utf-8" />
<meta name="generator" content="JsDoc Toolkit" />
<title>JsDoc Reference - jasmine.util</title>
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<!-- ============================== header ================================= -->
<!-- begin static/header.html -->
<div id="header">
</div>
<!-- end static/header.html -->
<!-- ============================== classes index ============================ -->
<div id="index">
<!-- begin publish.classesIndex -->
<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
<li><a href="../symbols/jasmine.html">jasmine</a></li>
<li><a href="../symbols/jasmine.Block.html">jasmine.Block</a></li>
<li><a href="../symbols/jasmine.Clock.html">jasmine.Clock</a></li>
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
<li><a href="../symbols/jasmine.util.html">jasmine.util</a></li>
</ul>
<hr />
<!-- end publish.classesIndex -->
</div>
<div id="content">
<!-- ============================== class title ============================ -->
<h1 class="classTitle">
Namespace jasmine.util
</h1>
<!-- ============================== class summary ========================== -->
<p class="description">
<br /><i>Defined in: </i> <a href="../symbols/src/src_util.js.html">util.js</a>.
</p>
<!-- ============================== constructor summary ==================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class jasmine.util.">
<caption>Namespace 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">&nbsp;</td>
<td class="nameDescription" >
<div class="fixedFont">
<b><a href="../symbols/jasmine.util.html">jasmine.util</a></b>
</div>
<div class="description"></div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== properties summary ===================== -->
<!-- ============================== methods summary ======================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class jasmine.util.">
<caption>Method Summary</caption>
<thead>
<tr>
<th scope="col">Method Attributes</th>
<th scope="col">Method Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&lt;static&gt; &nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">jasmine.util.<b><a href="../symbols/jasmine.util.html#.argsToArray">argsToArray</a></b>(args)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&lt;static&gt; &nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">jasmine.util.<b><a href="../symbols/jasmine.util.html#.extend">extend</a></b>(destination, source)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&lt;static&gt; &nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">jasmine.util.<b><a href="../symbols/jasmine.util.html#.formatException">formatException</a></b>(e)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&lt;static&gt; &nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">jasmine.util.<b><a href="../symbols/jasmine.util.html#.htmlEscape">htmlEscape</a></b>(str)
</div>
<div class="description"></div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== events summary ======================== -->
<!-- ============================== constructor details ==================== -->
<div class="details"><a name="constructor"> </a>
<div class="sectionTitle">
Namespace Detail
</div>
<div class="fixedFont">
<b>jasmine.util</b>
</div>
<div class="description">
</div>
</div>
<!-- ============================== field details ========================== -->
<!-- ============================== method details ========================= -->
<div class="sectionTitle">
Method Detail
</div>
<a name=".argsToArray"> </a>
<div class="fixedFont">&lt;static&gt;
<span class="light">jasmine.util.</span><b>argsToArray</b>(args)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>args</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name=".extend"> </a>
<div class="fixedFont">&lt;static&gt;
<span class="light">jasmine.util.</span><b>extend</b>(destination, source)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>destination</b>
</dt>
<dd></dd>
<dt>
<b>source</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name=".formatException"> </a>
<div class="fixedFont">&lt;static&gt;
<span class="light">jasmine.util.</span><b>formatException</b>(e)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>e</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name=".htmlEscape"> </a>
<div class="fixedFont">&lt;static&gt;
<span class="light">jasmine.util.</span><b>htmlEscape</b>(str)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>str</b>
</dt>
<dd></dd>
</dl>
<!-- ============================== event details ========================= -->
<hr />
</div>
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Jan 23 2010 13:48:22 GMT-0800 (PST)
</div>
</body>
</html>

View File

@ -1,124 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="NAME">jasmine.TrivialReporter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">doc</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 2</span> </span><span class="WHIT"> </span><span class="NAME">this.document</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">doc</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">document</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 3</span> </span><span class="WHIT"> </span><span class="NAME">this.suiteDivs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 4</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 5</span>
<span class='line'> 6</span> </span><span class="NAME">jasmine.TrivialReporter.prototype.createDom</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">type</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">childrenVarArgs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 7</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">el</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="NAME">type</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 8</span>
<span class='line'> 9</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">arguments.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">child</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 11</span>
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">child</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="NAME">el.appendChild</span><span class="PUNC">(</span><span class="NAME">document.createTextNode</span><span class="PUNC">(</span><span class="NAME">child</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">child</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">el.appendChild</span><span class="PUNC">(</span><span class="NAME">child</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 18</span>
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">attr</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="WHIT"> </span><span class="NAME">el</span><span class="PUNC">[</span><span class="NAME">attr</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">[</span><span class="NAME">attr</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 22</span>
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">el</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 25</span>
<span class='line'> 26</span> </span><span class="NAME">jasmine.TrivialReporter.prototype.reportRunnerStarting</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">runner</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">suites</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">runner.suites</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 28</span>
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="NAME">this.runnerDiv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.createDom</span><span class="PUNC">(</span><span class="STRN">'div'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">className</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'runner running'</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT"> </span><span class="NAME">this.createDom</span><span class="PUNC">(</span><span class="STRN">'a'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">className</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'run_spec'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">href</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'?'</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"run all"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="NAME">this.runnerMessageSpan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.createDom</span><span class="PUNC">(</span><span class="STRN">'span'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Running..."</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="NAME">this.document.body.appendChild</span><span class="PUNC">(</span><span class="NAME">this.runnerDiv</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 33</span>
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">suites.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">suites</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">suiteDiv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.createDom</span><span class="PUNC">(</span><span class="STRN">'div'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">className</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'suite'</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="NAME">this.createDom</span><span class="PUNC">(</span><span class="STRN">'a'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">className</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'run_spec'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">href</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'?spec='</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">encodeURIComponent</span><span class="PUNC">(</span><span class="NAME">suite.getFullName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"run"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="NAME">this.createDom</span><span class="PUNC">(</span><span class="STRN">'a'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">className</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'description'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">href</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'?spec='</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">encodeURIComponent</span><span class="PUNC">(</span><span class="NAME">suite.getFullName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">suite.description</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="NAME">this.suiteDivs</span><span class="PUNC">[</span><span class="NAME">suite.getFullName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">suiteDiv</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">parentDiv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.document.body</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">suite.parentSuite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="NAME">parentDiv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.suiteDivs</span><span class="PUNC">[</span><span class="NAME">suite.parentSuite.getFullName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="NAME">parentDiv.appendChild</span><span class="PUNC">(</span><span class="NAME">suiteDiv</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 46</span>
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="NAME">this.startedAt</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 49</span>
<span class='line'> 50</span> </span><span class="NAME">jasmine.TrivialReporter.prototype.reportRunnerResults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">runner</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">results</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">runner.results</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">className</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">results.failedCount</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"runner failed"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"runner passed"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="NAME">this.runnerDiv.setAttribute</span><span class="PUNC">(</span><span class="STRN">"class"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">className</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="COMM">//do it twice for IE</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="NAME">this.runnerDiv.setAttribute</span><span class="PUNC">(</span><span class="STRN">"className"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">className</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">specs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">runner.specs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">specCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">specs.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.specFilter</span><span class="PUNC">(</span><span class="NAME">specs</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="NAME">specCount</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">message</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">specCount</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" spec"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">specCount</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">""</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"s"</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">", "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">results.failedCount</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" failure"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">results.failedCount</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">""</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"s"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">message</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">" in "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">this.startedAt.getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"s"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="NAME">this.runnerMessageSpan.replaceChild</span><span class="PUNC">(</span><span class="NAME">this.createDom</span><span class="PUNC">(</span><span class="STRN">'a'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">className</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'description'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">href</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'?'</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.runnerMessageSpan.firstChild</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 67</span>
<span class='line'> 68</span> </span><span class="NAME">jasmine.TrivialReporter.prototype.reportSuiteResults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">suite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">results</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">suite.results</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">status</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">results.passed</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'passed'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'failed'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">results.totalCount</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// todo: change this to check results.skipped</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="NAME">status</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'skipped'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="NAME">this.suiteDivs</span><span class="PUNC">[</span><span class="NAME">suite.getFullName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">className</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">" "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">status</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 76</span>
<span class='line'> 77</span> </span><span class="NAME">jasmine.TrivialReporter.prototype.reportSpecResults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">spec</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">results</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">spec.results</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">status</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">results.passed</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'passed'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'failed'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">results.skipped</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="NAME">status</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'skipped'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">specDiv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.createDom</span><span class="PUNC">(</span><span class="STRN">'div'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">className</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'spec '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">status</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="NAME">this.createDom</span><span class="PUNC">(</span><span class="STRN">'a'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">className</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'run_spec'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">href</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'?spec='</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">encodeURIComponent</span><span class="PUNC">(</span><span class="NAME">spec.getFullName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"run"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="NAME">this.createDom</span><span class="PUNC">(</span><span class="STRN">'a'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">className</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'description'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">href</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'?spec='</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">encodeURIComponent</span><span class="PUNC">(</span><span class="NAME">spec.getFullName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">spec.getFullName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 86</span>
<span class='line'> 87</span>
<span class='line'> 88</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">resultItems</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">results.getItems</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">resultItems.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">resultItems</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">result.passed</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">result.passed</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="NAME">specDiv.appendChild</span><span class="PUNC">(</span><span class="NAME">this.createDom</span><span class="PUNC">(</span><span class="STRN">'div'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">className</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'resultMessage fail'</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">result.message</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="NAME">specDiv.appendChild</span><span class="PUNC">(</span><span class="NAME">this.createDom</span><span class="PUNC">(</span><span class="STRN">'div'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">className</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'stackTrace'</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">result.trace.stack</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT"> </span><span class="NAME">this.suiteDivs</span><span class="PUNC">[</span><span class="NAME">spec.suite.getFullName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">appendChild</span><span class="PUNC">(</span><span class="NAME">specDiv</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 98</span>
<span class='line'> 99</span> </span><span class="NAME">jasmine.TrivialReporter.prototype.log</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="NAME">console.log.apply</span><span class="PUNC">(</span><span class="NAME">console</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>101</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>102</span>
<span class='line'>103</span> </span><span class="NAME">jasmine.TrivialReporter.prototype.getLocation</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.document.location</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>105</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>106</span>
<span class='line'>107</span> </span><span class="NAME">jasmine.TrivialReporter.prototype.specFilter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">spec</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">paramMap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>109</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getLocation</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">search.substring</span><span class="PUNC">(</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">split</span><span class="PUNC">(</span><span class="STRN">'&'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">params.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">split</span><span class="PUNC">(</span><span class="STRN">'='</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="NAME">paramMap</span><span class="PUNC">[</span><span class="NAME">decodeURIComponent</span><span class="PUNC">(</span><span class="NAME">p</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">decodeURIComponent</span><span class="PUNC">(</span><span class="NAME">p</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>114</span>
<span class='line'>115</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">paramMap</span><span class="PUNC">[</span><span class="STRN">"spec"</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">spec.getFullName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">indexOf</span><span class="PUNC">(</span><span class="NAME">paramMap</span><span class="PUNC">[</span><span class="STRN">"spec"</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>117</span> </span><span class="PUNC">}</span><span class="PUNC">;</span></pre></body></html>

View File

@ -1,29 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
<span class='line'> 2</span> * Blocks are functions with executable code that make up a spec.
<span class='line'> 3</span> *
<span class='line'> 4</span> * @constructor
<span class='line'> 5</span> * @param {jasmine.Env} env
<span class='line'> 6</span> * @param {Function} func
<span class='line'> 7</span> * @param {jasmine.Spec} spec
<span class='line'> 8</span> */</span><span class="WHIT">
<span class='line'> 9</span> </span><span class="NAME">jasmine.Block</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">func</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="NAME">this.env</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">env</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="NAME">this.func</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">func</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="NAME">this.spec</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 13</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 14</span>
<span class='line'> 15</span> </span><span class="NAME">jasmine.Block.prototype.execute</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">onComplete</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="NAME">this.func.apply</span><span class="PUNC">(</span><span class="NAME">this.spec</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="NAME">this.spec.fail</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="NAME">onComplete</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="PUNC">}</span><span class="PUNC">;</span></pre></body></html>

View File

@ -1,240 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
<span class='line'> 2</span> * Environment for Jasmine
<span class='line'> 3</span> *
<span class='line'> 4</span> * @constructor
<span class='line'> 5</span> */</span><span class="WHIT">
<span class='line'> 6</span> </span><span class="NAME">jasmine.Env</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 7</span> </span><span class="WHIT"> </span><span class="NAME">this.currentSpec</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 8</span> </span><span class="WHIT"> </span><span class="NAME">this.currentSuite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 9</span> </span><span class="WHIT"> </span><span class="NAME">this.currentRunner_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Runner</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 10</span>
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="NAME">this.reporter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.MultiReporter</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 12</span>
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="NAME">this.updateInterval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.DEFAULT_UPDATE_INTERVAL</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="NAME">this.lastUpdate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="NAME">this.specFilter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 18</span>
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="NAME">this.nextSpecId_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="WHIT"> </span><span class="NAME">this.nextSuiteId_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="NAME">this.equalityTesters_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 22</span>
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="COMM">// wrap matchers</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="NAME">this.matchersClass</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.apply</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.util.inherit</span><span class="PUNC">(</span><span class="NAME">this.matchersClass</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 28</span>
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.wrapInto_</span><span class="PUNC">(</span><span class="NAME">jasmine.Matchers.prototype</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.matchersClass</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 31</span>
<span class='line'> 32</span>
<span class='line'> 33</span> </span><span class="NAME">jasmine.Env.prototype.setTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.setTimeout</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="NAME">jasmine.Env.prototype.clearTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.clearTimeout</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="NAME">jasmine.Env.prototype.setInterval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.setInterval</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="NAME">jasmine.Env.prototype.clearInterval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.clearInterval</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 37</span>
<span class='line'> 38</span> </span><span class="COMM">/**
<span class='line'> 39</span> * @returns an object containing jasmine version build info, if set.
<span class='line'> 40</span> */</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="NAME">jasmine.Env.prototype.version</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.version_</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.version_</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">'Version not set'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span>
<span class='line'> 49</span> </span><span class="COMM">/**
<span class='line'> 50</span> * @returns a sequential integer starting at 0
<span class='line'> 51</span> */</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="NAME">jasmine.Env.prototype.nextSpecId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.nextSpecId_</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 55</span>
<span class='line'> 56</span> </span><span class="COMM">/**
<span class='line'> 57</span> * @returns a sequential integer starting at 0
<span class='line'> 58</span> */</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="NAME">jasmine.Env.prototype.nextSuiteId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.nextSuiteId_</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 62</span>
<span class='line'> 63</span> </span><span class="COMM">/**
<span class='line'> 64</span> * Register a reporter to receive status updates from Jasmine.
<span class='line'> 65</span> * @param {jasmine.Reporter} reporter An object which will receive status updates.
<span class='line'> 66</span> */</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="NAME">jasmine.Env.prototype.addReporter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">reporter</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="NAME">this.reporter.addReporter</span><span class="PUNC">(</span><span class="NAME">reporter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 70</span>
<span class='line'> 71</span> </span><span class="NAME">jasmine.Env.prototype.execute</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="NAME">this.currentRunner_.execute</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 74</span>
<span class='line'> 75</span> </span><span class="NAME">jasmine.Env.prototype.describe</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">description</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">specDefinitions</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Suite</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">description</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">specDefinitions</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.currentSuite</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 77</span>
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">parentSuite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.currentSuite</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">parentSuite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="NAME">parentSuite.add</span><span class="PUNC">(</span><span class="NAME">suite</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="NAME">this.currentRunner_.add</span><span class="PUNC">(</span><span class="NAME">suite</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 84</span>
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="NAME">this.currentSuite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 86</span>
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="NAME">specDefinitions.call</span><span class="PUNC">(</span><span class="NAME">suite</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 88</span>
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="NAME">this.currentSuite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parentSuite</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 90</span>
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 93</span>
<span class='line'> 94</span> </span><span class="NAME">jasmine.Env.prototype.beforeEach</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">beforeEachFunction</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.currentSuite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT"> </span><span class="NAME">this.currentSuite.beforeEach</span><span class="PUNC">(</span><span class="NAME">beforeEachFunction</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="NAME">this.currentRunner_.beforeEach</span><span class="PUNC">(</span><span class="NAME">beforeEachFunction</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>100</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>101</span>
<span class='line'>102</span> </span><span class="NAME">jasmine.Env.prototype.currentRunner</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.currentRunner_</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>104</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>105</span>
<span class='line'>106</span> </span><span class="NAME">jasmine.Env.prototype.afterEach</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">afterEachFunction</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>107</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.currentSuite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="NAME">this.currentSuite.afterEach</span><span class="PUNC">(</span><span class="NAME">afterEachFunction</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>109</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="NAME">this.currentRunner_.afterEach</span><span class="PUNC">(</span><span class="NAME">afterEachFunction</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>112</span>
<span class='line'>113</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>114</span>
<span class='line'>115</span> </span><span class="NAME">jasmine.Env.prototype.xdescribe</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">desc</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">specDefinitions</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT"> </span><span class="NAME">execute</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>118</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>119</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>120</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>121</span>
<span class='line'>122</span> </span><span class="NAME">jasmine.Env.prototype.it</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">description</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">func</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>123</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Spec</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.currentSuite</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">description</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>124</span> </span><span class="WHIT"> </span><span class="NAME">this.currentSuite.add</span><span class="PUNC">(</span><span class="NAME">spec</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>125</span> </span><span class="WHIT"> </span><span class="NAME">this.currentSpec</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>126</span>
<span class='line'>127</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">func</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>128</span> </span><span class="WHIT"> </span><span class="NAME">spec.runs</span><span class="PUNC">(</span><span class="NAME">func</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>129</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>130</span>
<span class='line'>131</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>132</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>133</span>
<span class='line'>134</span> </span><span class="NAME">jasmine.Env.prototype.xit</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">desc</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">func</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>135</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.nextSpecId</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="NAME">runs</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>138</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>140</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>141</span>
<span class='line'>142</span> </span><span class="NAME">jasmine.Env.prototype.compareObjects_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchKeys</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchValues</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>143</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a.__Jasmine_been_here_before__</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">b.__Jasmine_been_here_before__</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>144</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>146</span>
<span class='line'>147</span> </span><span class="WHIT"> </span><span class="NAME">a.__Jasmine_been_here_before__</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>148</span> </span><span class="WHIT"> </span><span class="NAME">b.__Jasmine_been_here_before__</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>149</span>
<span class='line'>150</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hasKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">keyName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>151</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">keyName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">jasmine.undefined</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>152</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>153</span>
<span class='line'>154</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">property</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>155</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">hasKey</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">property</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">hasKey</span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">property</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>156</span> </span><span class="WHIT"> </span><span class="NAME">mismatchKeys.push</span><span class="PUNC">(</span><span class="STRN">"expected has key '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">property</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"', but missing from actual."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>157</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>158</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>159</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">property</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>160</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">hasKey</span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">property</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">hasKey</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">property</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>161</span> </span><span class="WHIT"> </span><span class="NAME">mismatchKeys.push</span><span class="PUNC">(</span><span class="STRN">"expected missing key '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">property</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"', but present in actual."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>162</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>163</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>164</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">property</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>165</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">property</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'__Jasmine_been_here_before__'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>166</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.equals_</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchKeys</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchValues</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>167</span> </span><span class="WHIT"> </span><span class="NAME">mismatchValues.push</span><span class="PUNC">(</span><span class="STRN">"'"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">property</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"' was '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">jasmine.util.htmlEscape</span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">toString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"' in expected, but was '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">jasmine.util.htmlEscape</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">toString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"' in actual."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>168</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>169</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>170</span>
<span class='line'>171</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.isArray_</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">jasmine.isArray_</span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">a.length</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">b.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>172</span> </span><span class="WHIT"> </span><span class="NAME">mismatchValues.push</span><span class="PUNC">(</span><span class="STRN">"arrays were not the same length"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>174</span>
<span class='line'>175</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">a.__Jasmine_been_here_before__</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>176</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">b.__Jasmine_been_here_before__</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>177</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">mismatchKeys.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">mismatchValues.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>178</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>179</span>
<span class='line'>180</span> </span><span class="NAME">jasmine.Env.prototype.equals_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchKeys</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchValues</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>181</span> </span><span class="WHIT"> </span><span class="NAME">mismatchKeys</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">mismatchKeys</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>182</span> </span><span class="WHIT"> </span><span class="NAME">mismatchValues</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">mismatchValues</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>183</span>
<span class='line'>184</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>185</span>
<span class='line'>186</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">jasmine.undefined</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">jasmine.undefined</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>187</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">jasmine.undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">jasmine.undefined</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>188</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>189</span>
<span class='line'>190</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.isDomNode</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">jasmine.isDomNode</span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>193</span>
<span class='line'>194</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>195</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a.getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">b.getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>196</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>197</span>
<span class='line'>198</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.Any</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>199</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a.matches</span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>200</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>201</span>
<span class='line'>202</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">b</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.Any</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>203</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">b.matches</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>204</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>205</span>
<span class='line'>206</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"object"</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"object"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>207</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.compareObjects_</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchKeys</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchValues</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>208</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>209</span>
<span class='line'>210</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">this.equalityTesters_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>211</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">equalityTester</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.equalityTesters_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>212</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">equalityTester</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchKeys</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchValues</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>213</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">jasmine.undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>214</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>215</span>
<span class='line'>216</span> </span><span class="WHIT"> </span><span class="COMM">//Straight check</span><span class="WHIT">
<span class='line'>217</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>218</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>219</span>
<span class='line'>220</span> </span><span class="NAME">jasmine.Env.prototype.contains_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">haystack</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">needle</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>221</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.isArray_</span><span class="PUNC">(</span><span class="NAME">haystack</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>222</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">haystack.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>223</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.equals_</span><span class="PUNC">(</span><span class="NAME">haystack</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">needle</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>224</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>225</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>226</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">haystack.indexOf</span><span class="PUNC">(</span><span class="NAME">needle</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>228</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>229</span>
<span class='line'>230</span> </span><span class="NAME">jasmine.Env.prototype.addEqualityTester</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">equalityTester</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT"> </span><span class="NAME">this.equalityTesters_.push</span><span class="PUNC">(</span><span class="NAME">equalityTester</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>232</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>233</span> </span></pre></body></html>

View File

@ -1,111 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/** JavaScript API reporter.
<span class='line'> 2</span> *
<span class='line'> 3</span> * @constructor
<span class='line'> 4</span> */</span><span class="WHIT">
<span class='line'> 5</span> </span><span class="NAME">jasmine.JsApiReporter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 6</span> </span><span class="WHIT"> </span><span class="NAME">this.started</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 7</span> </span><span class="WHIT"> </span><span class="NAME">this.finished</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 8</span> </span><span class="WHIT"> </span><span class="NAME">this.suites_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 9</span> </span><span class="WHIT"> </span><span class="NAME">this.results_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 11</span>
<span class='line'> 12</span> </span><span class="NAME">jasmine.JsApiReporter.prototype.reportRunnerStarting</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">runner</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="NAME">this.started</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">suites</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">runner.suites</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">suites.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">suites</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="NAME">this.suites_.push</span><span class="PUNC">(</span><span class="NAME">this.summarize_</span><span class="PUNC">(</span><span class="NAME">suite</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 20</span>
<span class='line'> 21</span> </span><span class="NAME">jasmine.JsApiReporter.prototype.suites</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.suites_</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 24</span>
<span class='line'> 25</span> </span><span class="NAME">jasmine.JsApiReporter.prototype.summarize_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">suiteOrSpec</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">isSuite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">suiteOrSpec</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">jasmine.Suite</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">summary</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">suiteOrSpec.id</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">suiteOrSpec.description</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">isSuite</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'suite'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'spec'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="NAME">children</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">isSuite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">specs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">suiteOrSpec.specs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">specs.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="NAME">summary.children.push</span><span class="PUNC">(</span><span class="NAME">this.summarize_</span><span class="PUNC">(</span><span class="NAME">specs</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">summary</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 41</span>
<span class='line'> 42</span> </span><span class="NAME">jasmine.JsApiReporter.prototype.results</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.results_</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 45</span>
<span class='line'> 46</span> </span><span class="NAME">jasmine.JsApiReporter.prototype.resultsForSpec</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">specId</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.results_</span><span class="PUNC">[</span><span class="NAME">specId</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 49</span>
<span class='line'> 50</span> </span><span class="COMM">//noinspection JSUnusedLocalSymbols</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="NAME">jasmine.JsApiReporter.prototype.reportRunnerResults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">runner</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="NAME">this.finished</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 54</span>
<span class='line'> 55</span> </span><span class="COMM">//noinspection JSUnusedLocalSymbols</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="NAME">jasmine.JsApiReporter.prototype.reportSuiteResults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">suite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 58</span>
<span class='line'> 59</span> </span><span class="COMM">//noinspection JSUnusedLocalSymbols</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="NAME">jasmine.JsApiReporter.prototype.reportSpecResults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">spec</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="NAME">this.results_</span><span class="PUNC">[</span><span class="NAME">spec.id</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="NAME">messages</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">spec.results</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getItems</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">spec.results</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">failedCount</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"failed"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"passed"</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 66</span>
<span class='line'> 67</span> </span><span class="COMM">//noinspection JSUnusedLocalSymbols</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="NAME">jasmine.JsApiReporter.prototype.log</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 70</span>
<span class='line'> 71</span> </span><span class="NAME">jasmine.JsApiReporter.prototype.resultsForSpecs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">specIds</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">results</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">specIds.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">specId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">specIds</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="NAME">results</span><span class="PUNC">[</span><span class="NAME">specId</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.summarizeResult_</span><span class="PUNC">(</span><span class="NAME">this.results_</span><span class="PUNC">[</span><span class="NAME">specId</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">results</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 79</span>
<span class='line'> 80</span> </span><span class="NAME">jasmine.JsApiReporter.prototype.summarizeResult_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">summaryMessages</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">messagesLength</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">result.messages.length</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">messageIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">messageIndex</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">messagesLength</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">messageIndex</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">resultMessage</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">result.messages</span><span class="PUNC">[</span><span class="NAME">messageIndex</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="NAME">summaryMessages.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">resultMessage.text</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="NAME">passed</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">resultMessage.passed</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">resultMessage.passed</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">resultMessage.type</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">resultMessage.message</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="NAME">trace</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="NAME">stack</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">resultMessage.passed</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">resultMessage.passed</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">resultMessage.trace.stack</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">jasmine.undefined</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 95</span>
<span class='line'> 96</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">summaryResult</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">result.result</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="NAME">messages</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">summaryMessages</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>100</span>
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">summaryResult</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>102</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>103</span>
<span class='line'>104</span> </span></pre></body></html>

View File

@ -1,328 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
<span class='line'> 2</span> * @constructor
<span class='line'> 3</span> * @param {jasmine.Env} env
<span class='line'> 4</span> * @param actual
<span class='line'> 5</span> * @param {jasmine.Spec} spec
<span class='line'> 6</span> */</span><span class="WHIT">
<span class='line'> 7</span> </span><span class="NAME">jasmine.Matchers</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">actual</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 8</span> </span><span class="WHIT"> </span><span class="NAME">this.env</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">env</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 9</span> </span><span class="WHIT"> </span><span class="NAME">this.actual</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">actual</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="NAME">this.spec</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="NAME">this.reportWasCalled_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 12</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 13</span>
<span class='line'> 14</span> </span><span class="NAME">jasmine.Matchers.pp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.util.htmlEscape</span><span class="PUNC">(</span><span class="NAME">jasmine.pp</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 17</span>
<span class='line'> 18</span> </span><span class="COMM">/** @deprecated */</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="NAME">jasmine.Matchers.prototype.report</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">failing_message</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">details</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="COMM">// todo first: report deprecation warning [xw]</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="COMM">// todo later: throw new Error("As of jasmine 0.xx, custom matchers must be implemented differently -- please see jasmine docs");</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="NAME">this.reportWasCalled_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">expectationResult</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.ExpectationResult</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="NAME">passed</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">failing_message</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="NAME">details</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">details</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="NAME">this.spec.addMatcherResult</span><span class="PUNC">(</span><span class="NAME">expectationResult</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 31</span>
<span class='line'> 32</span> </span><span class="NAME">jasmine.Matchers.wrapInto_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">prototype</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">matchersClass</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">methodName</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">prototype</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">methodName</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'report'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">orig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">prototype</span><span class="PUNC">[</span><span class="NAME">methodName</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="NAME">matchersClass.prototype</span><span class="PUNC">[</span><span class="NAME">methodName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.matcherFn_</span><span class="PUNC">(</span><span class="NAME">methodName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">orig</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 39</span>
<span class='line'> 40</span> </span><span class="NAME">jasmine.Matchers.matcherFn_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">matcherName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">matcherFunction</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">matcherArgs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.util.argsToArray</span><span class="PUNC">(</span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">matcherFunction.apply</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.reportWasCalled_</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT">
<span class='line'> 46</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="NAME">message</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.message.apply</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">englishyPredicate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">matcherName.replace</span><span class="PUNC">(</span><span class="REGX">/[A-Z]/g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">' '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">s.toLowerCase</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="NAME">message</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"Expected "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.pp</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">englishyPredicate</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">matcherArgs.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">matcherArgs.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">message</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">","</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="NAME">message</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">" "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.pp</span><span class="PUNC">(</span><span class="NAME">matcherArgs</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="NAME">message</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"."</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">expectationResult</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.ExpectationResult</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="NAME">matcherName</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">matcherName</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">passed</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">matcherArgs.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">matcherArgs</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">matcherArgs</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="NAME">actual</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.actual</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">message</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="NAME">this.spec.addMatcherResult</span><span class="PUNC">(</span><span class="NAME">expectationResult</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 73</span>
<span class='line'> 74</span>
<span class='line'> 75</span>
<span class='line'> 76</span>
<span class='line'> 77</span> </span><span class="COMM">/**
<span class='line'> 78</span> * toBe: compares the actual to the expected using ===
<span class='line'> 79</span> * @param expected
<span class='line'> 80</span> */</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="NAME">jasmine.Matchers.prototype.toBe</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.actual</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 84</span>
<span class='line'> 85</span> </span><span class="COMM">/**
<span class='line'> 86</span> * toNotBe: compares the actual to the expected using !==
<span class='line'> 87</span> * @param expected
<span class='line'> 88</span> */</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="NAME">jasmine.Matchers.prototype.toNotBe</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.actual</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 92</span>
<span class='line'> 93</span> </span><span class="COMM">/**
<span class='line'> 94</span> * toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc.
<span class='line'> 95</span> *
<span class='line'> 96</span> * @param expected
<span class='line'> 97</span> */</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="NAME">jasmine.Matchers.prototype.toEqual</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.env.equals_</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>100</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>101</span>
<span class='line'>102</span> </span><span class="COMM">/**
<span class='line'>103</span> * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual
<span class='line'>104</span> * @param expected
<span class='line'>105</span> */</span><span class="WHIT">
<span class='line'>106</span> </span><span class="NAME">jasmine.Matchers.prototype.toNotEqual</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>107</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">this.env.equals_</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>108</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>109</span>
<span class='line'>110</span> </span><span class="COMM">/**
<span class='line'>111</span> * Matcher that compares the actual to the expected using a regular expression. Constructs a RegExp, so takes
<span class='line'>112</span> * a pattern or a String.
<span class='line'>113</span> *
<span class='line'>114</span> * @param expected
<span class='line'>115</span> */</span><span class="WHIT">
<span class='line'>116</span> </span><span class="NAME">jasmine.Matchers.prototype.toMatch</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>118</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>119</span>
<span class='line'>120</span> </span><span class="COMM">/**
<span class='line'>121</span> * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch
<span class='line'>122</span> * @param expected
<span class='line'>123</span> */</span><span class="WHIT">
<span class='line'>124</span> </span><span class="NAME">jasmine.Matchers.prototype.toNotMatch</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>125</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>126</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>127</span>
<span class='line'>128</span> </span><span class="COMM">/**
<span class='line'>129</span> * Matcher that compares the actual to jasmine.undefined.
<span class='line'>130</span> */</span><span class="WHIT">
<span class='line'>131</span> </span><span class="NAME">jasmine.Matchers.prototype.toBeDefined</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>132</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">jasmine.undefined</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>133</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>134</span>
<span class='line'>135</span> </span><span class="COMM">/**
<span class='line'>136</span> * Matcher that compares the actual to jasmine.undefined.
<span class='line'>137</span> */</span><span class="WHIT">
<span class='line'>138</span> </span><span class="NAME">jasmine.Matchers.prototype.toBeUndefined</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">jasmine.undefined</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>140</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>141</span>
<span class='line'>142</span> </span><span class="COMM">/**
<span class='line'>143</span> * Matcher that compares the actual to null.
<span class='line'>144</span> */</span><span class="WHIT">
<span class='line'>145</span> </span><span class="NAME">jasmine.Matchers.prototype.toBeNull</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>146</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>147</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>148</span>
<span class='line'>149</span> </span><span class="COMM">/**
<span class='line'>150</span> * Matcher that boolean not-nots the actual.
<span class='line'>151</span> */</span><span class="WHIT">
<span class='line'>152</span> </span><span class="NAME">jasmine.Matchers.prototype.toBeTruthy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>153</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="PUNC">!</span><span class="NAME">this.actual</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>154</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>155</span>
<span class='line'>156</span>
<span class='line'>157</span> </span><span class="COMM">/**
<span class='line'>158</span> * Matcher that boolean nots the actual.
<span class='line'>159</span> */</span><span class="WHIT">
<span class='line'>160</span> </span><span class="NAME">jasmine.Matchers.prototype.toBeFalsy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>161</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">this.actual</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>162</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>163</span>
<span class='line'>164</span> </span><span class="COMM">/**
<span class='line'>165</span> * Matcher that checks to see if the actual, a Jasmine spy, was called.
<span class='line'>166</span> */</span><span class="WHIT">
<span class='line'>167</span> </span><span class="NAME">jasmine.Matchers.prototype.wasCalled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>168</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">arguments.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>169</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">'wasCalled does not take arguments, use wasCalledWith'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>170</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>171</span>
<span class='line'>172</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">jasmine.isSpy</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">'Expected a spy, but got '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>174</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>175</span>
<span class='line'>176</span> </span><span class="WHIT"> </span><span class="NAME">this.message</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>177</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">"Expected spy "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.actual.identity</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" to have been called."</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>178</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>179</span>
<span class='line'>180</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.actual.wasCalled</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>181</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>182</span>
<span class='line'>183</span> </span><span class="COMM">/**
<span class='line'>184</span> * Matcher that checks to see if the actual, a Jasmine spy, was not called.
<span class='line'>185</span> */</span><span class="WHIT">
<span class='line'>186</span> </span><span class="NAME">jasmine.Matchers.prototype.wasNotCalled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>187</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">arguments.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>188</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">'wasNotCalled does not take arguments'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>189</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>190</span>
<span class='line'>191</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">jasmine.isSpy</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">'Expected a spy, but got '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>193</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>194</span>
<span class='line'>195</span> </span><span class="WHIT"> </span><span class="NAME">this.message</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>196</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">"Expected spy "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.actual.identity</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" to not have been called."</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>197</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>198</span>
<span class='line'>199</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">this.actual.wasCalled</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>200</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>201</span>
<span class='line'>202</span> </span><span class="COMM">/**
<span class='line'>203</span> * Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters.
<span class='line'>204</span> *
<span class='line'>205</span> * @example
<span class='line'>206</span> *
<span class='line'>207</span> */</span><span class="WHIT">
<span class='line'>208</span> </span><span class="NAME">jasmine.Matchers.prototype.wasCalledWith</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>209</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">jasmine.isSpy</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>210</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">'Expected a spy, but got '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>211</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>212</span>
<span class='line'>213</span> </span><span class="WHIT"> </span><span class="NAME">this.message</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>214</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.actual.callCount</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>215</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">"Expected spy to have been called with "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.pp</span><span class="PUNC">(</span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" but it was never called."</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>216</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>217</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">"Expected spy to have been called with "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.pp</span><span class="PUNC">(</span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" but was called with "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.pp</span><span class="PUNC">(</span><span class="NAME">this.actual.argsForCall</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>218</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>219</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>220</span>
<span class='line'>221</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.env.contains_</span><span class="PUNC">(</span><span class="NAME">this.actual.argsForCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">jasmine.util.argsToArray</span><span class="PUNC">(</span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>222</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>223</span>
<span class='line'>224</span> </span><span class="NAME">jasmine.Matchers.prototype.wasNotCalledWith</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>225</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">jasmine.isSpy</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>226</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">'Expected a spy, but got '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>228</span>
<span class='line'>229</span> </span><span class="WHIT"> </span><span class="NAME">this.message</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>230</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">"Expected spy not to have been called with "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.pp</span><span class="PUNC">(</span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" but it was"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>232</span>
<span class='line'>233</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">this.env.contains_</span><span class="PUNC">(</span><span class="NAME">this.actual.argsForCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">jasmine.util.argsToArray</span><span class="PUNC">(</span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>234</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>235</span>
<span class='line'>236</span> </span><span class="COMM">/**
<span class='line'>237</span> * Matcher that checks that the expected item is an element in the actual Array.
<span class='line'>238</span> *
<span class='line'>239</span> * @param {Object} expected
<span class='line'>240</span> */</span><span class="WHIT">
<span class='line'>241</span> </span><span class="NAME">jasmine.Matchers.prototype.toContain</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>242</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.env.contains_</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>243</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>244</span>
<span class='line'>245</span> </span><span class="COMM">/**
<span class='line'>246</span> * Matcher that checks that the expected item is NOT an element in the actual Array.
<span class='line'>247</span> *
<span class='line'>248</span> * @param {Object} expected
<span class='line'>249</span> */</span><span class="WHIT">
<span class='line'>250</span> </span><span class="NAME">jasmine.Matchers.prototype.toNotContain</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>251</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">this.env.contains_</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>252</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>253</span>
<span class='line'>254</span> </span><span class="NAME">jasmine.Matchers.prototype.toBeLessThan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>255</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.actual</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>256</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>257</span>
<span class='line'>258</span> </span><span class="NAME">jasmine.Matchers.prototype.toBeGreaterThan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>259</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.actual</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>260</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>261</span>
<span class='line'>262</span> </span><span class="COMM">/**
<span class='line'>263</span> * Matcher that checks that the expected exception was thrown by the actual.
<span class='line'>264</span> *
<span class='line'>265</span> * @param {String} expected
<span class='line'>266</span> */</span><span class="WHIT">
<span class='line'>267</span> </span><span class="NAME">jasmine.Matchers.prototype.toThrow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>268</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>269</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">exception</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>270</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">this.actual</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>271</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">'Actual is not a function'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>272</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>273</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>274</span> </span><span class="WHIT"> </span><span class="NAME">this.actual</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>275</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>276</span> </span><span class="WHIT"> </span><span class="NAME">exception</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>277</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>278</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">exception</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>279</span> </span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">expected</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">jasmine.undefined</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">this.env.equals_</span><span class="PUNC">(</span><span class="NAME">exception.message</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">exception</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">expected.message</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>280</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>281</span>
<span class='line'>282</span> </span><span class="WHIT"> </span><span class="NAME">this.message</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>283</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">exception</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">expected</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">jasmine.undefined</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">this.env.equals_</span><span class="PUNC">(</span><span class="NAME">exception.message</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">exception</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">expected.message</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>284</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Expected function to throw"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">expected.message</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">", but it threw"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">exception.message</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">exception</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">join</span><span class="PUNC">(</span><span class="STRN">' '</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">"Expected function to throw an exception."</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>287</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>288</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>289</span>
<span class='line'>290</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>291</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>292</span>
<span class='line'>293</span> </span><span class="NAME">jasmine.Matchers.Any</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">expectedClass</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>294</span> </span><span class="WHIT"> </span><span class="NAME">this.expectedClass</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">expectedClass</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>295</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>296</span>
<span class='line'>297</span> </span><span class="NAME">jasmine.Matchers.Any.prototype.matches</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">other</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>298</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.expectedClass</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">String</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>299</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">other</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">other</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">String</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>300</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>301</span>
<span class='line'>302</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.expectedClass</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Number</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>303</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">other</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'number'</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">other</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">Number</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>304</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>305</span>
<span class='line'>306</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.expectedClass</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Function</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>307</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">other</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">other</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">Function</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>308</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>309</span>
<span class='line'>310</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.expectedClass</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Object</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>311</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">other</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>312</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>313</span>
<span class='line'>314</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">other</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">this.expectedClass</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>315</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>316</span>
<span class='line'>317</span> </span><span class="NAME">jasmine.Matchers.Any.prototype.toString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>318</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'&lt;jasmine.any('</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.expectedClass</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">')>'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>319</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>320</span>
<span class='line'>321</span> </span></pre></body></html>

View File

@ -1,36 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
<span class='line'> 2</span> * @constructor
<span class='line'> 3</span> */</span><span class="WHIT">
<span class='line'> 4</span> </span><span class="NAME">jasmine.MultiReporter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 5</span> </span><span class="WHIT"> </span><span class="NAME">this.subReporters_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 6</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 7</span> </span><span class="NAME">jasmine.util.inherit</span><span class="PUNC">(</span><span class="NAME">jasmine.MultiReporter</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">jasmine.Reporter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 8</span>
<span class='line'> 9</span> </span><span class="NAME">jasmine.MultiReporter.prototype.addReporter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">reporter</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="NAME">this.subReporters_.push</span><span class="PUNC">(</span><span class="NAME">reporter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 12</span>
<span class='line'> 13</span> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">functionNames</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"reportRunnerStarting"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"reportRunnerResults"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"reportSuiteResults"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"reportSpecResults"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"log"</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">functionNames.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">functionName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">functionNames</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.MultiReporter.prototype</span><span class="PUNC">[</span><span class="NAME">functionName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">functionName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">this.subReporters_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">subReporter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.subReporters_</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">subReporter</span><span class="PUNC">[</span><span class="NAME">functionName</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="NAME">subReporter</span><span class="PUNC">[</span><span class="NAME">functionName</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">apply</span><span class="PUNC">(</span><span class="NAME">subReporter</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="NAME">functionName</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 29</span> </span></pre></body></html>

View File

@ -1,88 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
<span class='line'> 2</span> * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults
<span class='line'> 3</span> *
<span class='line'> 4</span> * @constructor
<span class='line'> 5</span> */</span><span class="WHIT">
<span class='line'> 6</span> </span><span class="NAME">jasmine.NestedResults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 7</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 8</span> * The total count of results
<span class='line'> 9</span> */</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="NAME">this.totalCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 12</span> * Number of passed results
<span class='line'> 13</span> */</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="NAME">this.passedCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 16</span> * Number of failed results
<span class='line'> 17</span> */</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="NAME">this.failedCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 20</span> * Was this suite/spec skipped?
<span class='line'> 21</span> */</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="NAME">this.skipped</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 24</span> * @ignore
<span class='line'> 25</span> */</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="NAME">this.items_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 28</span>
<span class='line'> 29</span> </span><span class="COMM">/**
<span class='line'> 30</span> * Roll up the result counts.
<span class='line'> 31</span> *
<span class='line'> 32</span> * @param result
<span class='line'> 33</span> */</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="NAME">jasmine.NestedResults.prototype.rollupCounts</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="NAME">this.totalCount</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">result.totalCount</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="NAME">this.passedCount</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">result.passedCount</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="NAME">this.failedCount</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">result.failedCount</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 39</span>
<span class='line'> 40</span> </span><span class="COMM">/**
<span class='line'> 41</span> * Tracks a result's message.
<span class='line'> 42</span> * @param message
<span class='line'> 43</span> */</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="NAME">jasmine.NestedResults.prototype.log</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="NAME">this.items_.push</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.MessageResult</span><span class="PUNC">(</span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 47</span>
<span class='line'> 48</span> </span><span class="COMM">/**
<span class='line'> 49</span> * Getter for the results: message & results.
<span class='line'> 50</span> */</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="NAME">jasmine.NestedResults.prototype.getItems</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.items_</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 54</span>
<span class='line'> 55</span> </span><span class="COMM">/**
<span class='line'> 56</span> * Adds a result, tracking counts (total, passed, & failed)
<span class='line'> 57</span> * @param {jasmine.ExpectationResult|jasmine.NestedResults} result
<span class='line'> 58</span> */</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="NAME">jasmine.NestedResults.prototype.addResult</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">result.type</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'MessageResult'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">result.items_</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="NAME">this.rollupCounts</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">this.totalCount</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">result.passed</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="NAME">this.passedCount</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="NAME">this.failedCount</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="NAME">this.items_.push</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 74</span>
<span class='line'> 75</span> </span><span class="COMM">/**
<span class='line'> 76</span> * @returns {Boolean} True if &lt;b>everything&lt;/b> below passed
<span class='line'> 77</span> */</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="NAME">jasmine.NestedResults.prototype.passed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.passedCount</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">this.totalCount</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 81</span> </span></pre></body></html>

View File

@ -1,130 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
<span class='line'> 2</span> * Base class for pretty printing for expectation results.
<span class='line'> 3</span> */</span><span class="WHIT">
<span class='line'> 4</span> </span><span class="NAME">jasmine.PrettyPrinter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 5</span> </span><span class="WHIT"> </span><span class="NAME">this.ppNestLevel_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 6</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 7</span>
<span class='line'> 8</span> </span><span class="COMM">/**
<span class='line'> 9</span> * Formats a value in a nice, human-readable string.
<span class='line'> 10</span> *
<span class='line'> 11</span> * @param value
<span class='line'> 12</span> */</span><span class="WHIT">
<span class='line'> 13</span> </span><span class="NAME">jasmine.PrettyPrinter.prototype.format</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.ppNestLevel_</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">40</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">'jasmine.PrettyPrinter: format() nested too deeply!'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 17</span>
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="NAME">this.ppNestLevel_</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">jasmine.undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="STRN">'null'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value.navigator</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">value.frames</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">value.setTimeout</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="STRN">'&lt;window>'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.Any</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="NAME">value.toString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="NAME">this.emitString</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.isSpy</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="STRN">"spy on "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">value.identity</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="NAME">value.toString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="STRN">'Function'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value.nodeType</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'number'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="STRN">'HTMLNode'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="STRN">'Date('</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">')'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value.__Jasmine_been_here_before__</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="STRN">'&lt;circular reference: '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.isArray_</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'Array'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'Object'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'>'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.isArray_</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="NAME">value.__Jasmine_been_here_before__</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.isArray_</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="NAME">this.emitArray</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="NAME">this.emitObject</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">value.__Jasmine_been_here_before__</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="NAME">value.toString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">finally</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="NAME">this.ppNestLevel_</span><span class="PUNC">--</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 57</span>
<span class='line'> 58</span> </span><span class="NAME">jasmine.PrettyPrinter.prototype.iterateObject</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fn</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">property</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">property</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'__Jasmine_been_here_before__'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="NAME">fn</span><span class="PUNC">(</span><span class="NAME">property</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">obj.__lookupGetter__</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">obj.__lookupGetter__</span><span class="PUNC">(</span><span class="NAME">property</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 64</span>
<span class='line'> 65</span> </span><span class="NAME">jasmine.PrettyPrinter.prototype.emitArray</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.unimplementedMethod_</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="NAME">jasmine.PrettyPrinter.prototype.emitObject</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.unimplementedMethod_</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="NAME">jasmine.PrettyPrinter.prototype.emitScalar</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.unimplementedMethod_</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="NAME">jasmine.PrettyPrinter.prototype.emitString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.unimplementedMethod_</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 69</span>
<span class='line'> 70</span> </span><span class="NAME">jasmine.StringPrettyPrinter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.PrettyPrinter.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 72</span>
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="NAME">this.string</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="NAME">jasmine.util.inherit</span><span class="PUNC">(</span><span class="NAME">jasmine.StringPrettyPrinter</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">jasmine.PrettyPrinter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 76</span>
<span class='line'> 77</span> </span><span class="NAME">jasmine.StringPrettyPrinter.prototype.emitScalar</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="NAME">this.append</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 80</span>
<span class='line'> 81</span> </span><span class="NAME">jasmine.StringPrettyPrinter.prototype.emitString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="NAME">this.append</span><span class="PUNC">(</span><span class="STRN">"'"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"'"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 84</span>
<span class='line'> 85</span> </span><span class="NAME">jasmine.StringPrettyPrinter.prototype.emitArray</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">array</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="NAME">this.append</span><span class="PUNC">(</span><span class="STRN">'[ '</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">array.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="NAME">this.append</span><span class="PUNC">(</span><span class="STRN">', '</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="NAME">this.format</span><span class="PUNC">(</span><span class="NAME">array</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="NAME">this.append</span><span class="PUNC">(</span><span class="STRN">' ]'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 95</span>
<span class='line'> 96</span> </span><span class="NAME">jasmine.StringPrettyPrinter.prototype.emitObject</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="NAME">this.append</span><span class="PUNC">(</span><span class="STRN">'{ '</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">first</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>100</span>
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="NAME">this.iterateObject</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">property</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">isGetter</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">first</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="NAME">first</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT"> </span><span class="NAME">self.append</span><span class="PUNC">(</span><span class="STRN">', '</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>107</span>
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="NAME">self.append</span><span class="PUNC">(</span><span class="NAME">property</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>109</span> </span><span class="WHIT"> </span><span class="NAME">self.append</span><span class="PUNC">(</span><span class="STRN">' : '</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">isGetter</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT"> </span><span class="NAME">self.append</span><span class="PUNC">(</span><span class="STRN">'&lt;getter>'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT"> </span><span class="NAME">self.format</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>115</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>116</span>
<span class='line'>117</span> </span><span class="WHIT"> </span><span class="NAME">this.append</span><span class="PUNC">(</span><span class="STRN">' }'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>118</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>119</span>
<span class='line'>120</span> </span><span class="NAME">jasmine.StringPrettyPrinter.prototype.append</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT"> </span><span class="NAME">this.string</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>122</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>123</span> </span></pre></body></html>

View File

@ -1,102 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="NAME">jasmine.Queue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">env</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 2</span> </span><span class="WHIT"> </span><span class="NAME">this.env</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">env</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 3</span> </span><span class="WHIT"> </span><span class="NAME">this.blocks</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 4</span> </span><span class="WHIT"> </span><span class="NAME">this.running</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 5</span> </span><span class="WHIT"> </span><span class="NAME">this.index</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 6</span> </span><span class="WHIT"> </span><span class="NAME">this.offset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 7</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 8</span>
<span class='line'> 9</span> </span><span class="NAME">jasmine.Queue.prototype.addBefore</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="NAME">this.blocks.unshift</span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 12</span>
<span class='line'> 13</span> </span><span class="NAME">jasmine.Queue.prototype.add</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="NAME">this.blocks.push</span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 16</span>
<span class='line'> 17</span> </span><span class="NAME">jasmine.Queue.prototype.insertNext</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="NAME">this.blocks.splice</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">this.index</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.offset</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">block</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="NAME">this.offset</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 21</span>
<span class='line'> 22</span> </span><span class="NAME">jasmine.Queue.prototype.start</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">onComplete</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="NAME">this.running</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="NAME">this.onComplete</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">onComplete</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="NAME">this.next_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 27</span>
<span class='line'> 28</span> </span><span class="NAME">jasmine.Queue.prototype.isRunning</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.running</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 31</span>
<span class='line'> 32</span> </span><span class="NAME">jasmine.Queue.LOOP_DONT_RECURSE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 33</span>
<span class='line'> 34</span> </span><span class="NAME">jasmine.Queue.prototype.next_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">goAgain</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 37</span>
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="KEYW">while</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">goAgain</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="NAME">goAgain</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT">
<span class='line'> 41</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">self.index</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">self.blocks.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">calledSynchronously</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">completedSynchronously</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 44</span>
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">onComplete</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.Queue.LOOP_DONT_RECURSE</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">calledSynchronously</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="NAME">completedSynchronously</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 50</span>
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="NAME">self.offset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="NAME">self.index</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 53</span>
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">now</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">self.env.updateInterval</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">now</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">self.env.lastUpdate</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">self.env.updateInterval</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="NAME">self.env.lastUpdate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">now</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="NAME">self.env.setTimeout</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="NAME">self.next_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.Queue.LOOP_DONT_RECURSE</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">completedSynchronously</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="NAME">goAgain</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">self.next_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="NAME">self.blocks</span><span class="PUNC">[</span><span class="NAME">self.index</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">execute</span><span class="PUNC">(</span><span class="NAME">onComplete</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 69</span>
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="NAME">calledSynchronously</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">completedSynchronously</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="NAME">onComplete</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="WHIT">
<span class='line'> 75</span> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="NAME">self.running</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">self.onComplete</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="NAME">self.onComplete</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 83</span>
<span class='line'> 84</span> </span><span class="NAME">jasmine.Queue.prototype.results</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">results</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.NestedResults</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">this.blocks.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.blocks</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">results</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT"> </span><span class="NAME">results.addResult</span><span class="PUNC">(</span><span class="NAME">this.blocks</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">results</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">results</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 93</span>
<span class='line'> 94</span>
<span class='line'> 95</span> </span></pre></body></html>

View File

@ -1,35 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/** No-op base class for Jasmine reporters.
<span class='line'> 2</span> *
<span class='line'> 3</span> * @constructor
<span class='line'> 4</span> */</span><span class="WHIT">
<span class='line'> 5</span> </span><span class="NAME">jasmine.Reporter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 6</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 7</span>
<span class='line'> 8</span> </span><span class="COMM">//noinspection JSUnusedLocalSymbols</span><span class="WHIT">
<span class='line'> 9</span> </span><span class="NAME">jasmine.Reporter.prototype.reportRunnerStarting</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">runner</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 11</span>
<span class='line'> 12</span> </span><span class="COMM">//noinspection JSUnusedLocalSymbols</span><span class="WHIT">
<span class='line'> 13</span> </span><span class="NAME">jasmine.Reporter.prototype.reportRunnerResults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">runner</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 15</span>
<span class='line'> 16</span> </span><span class="COMM">//noinspection JSUnusedLocalSymbols</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="NAME">jasmine.Reporter.prototype.reportSuiteResults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">suite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 19</span>
<span class='line'> 20</span> </span><span class="COMM">//noinspection JSUnusedLocalSymbols</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="NAME">jasmine.Reporter.prototype.reportSpecResults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">spec</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 23</span>
<span class='line'> 24</span> </span><span class="COMM">//noinspection JSUnusedLocalSymbols</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="NAME">jasmine.Reporter.prototype.log</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 27</span>
<span class='line'> 28</span> </span></pre></body></html>

View File

@ -1,51 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/** JasmineReporters.reporter
<span class='line'> 2</span> * Base object that will get called whenever a Spec, Suite, or Runner is done. It is up to
<span class='line'> 3</span> * descendants of this object to do something with the results (see json_reporter.js)
<span class='line'> 4</span> *
<span class='line'> 5</span> * @deprecated
<span class='line'> 6</span> */</span><span class="WHIT">
<span class='line'> 7</span> </span><span class="NAME">jasmine.Reporters</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 8</span>
<span class='line'> 9</span> </span><span class="COMM">/**
<span class='line'> 10</span> * @deprecated
<span class='line'> 11</span> * @param callbacks
<span class='line'> 12</span> */</span><span class="WHIT">
<span class='line'> 13</span> </span><span class="NAME">jasmine.Reporters.reporter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">callbacks</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 15</span> * @deprecated
<span class='line'> 16</span> * @param callbacks
<span class='line'> 17</span> */</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">that</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="NAME">callbacks</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">callbacks</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 20</span>
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="NAME">doCallback</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">results</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">results</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 26</span>
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="NAME">reportRunnerResults</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">runner</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="NAME">that.doCallback</span><span class="PUNC">(</span><span class="NAME">that.callbacks.runnerCallback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">runner</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT"> </span><span class="NAME">reportSuiteResults</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">suite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="NAME">that.doCallback</span><span class="PUNC">(</span><span class="NAME">that.callbacks.suiteCallback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="NAME">reportSpecResults</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">spec</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="NAME">that.doCallback</span><span class="PUNC">(</span><span class="NAME">that.callbacks.specCallback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="NAME">log</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">console</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 40</span>
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">that</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 43</span>
<span class='line'> 44</span> </span></pre></body></html>

View File

@ -1,75 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
<span class='line'> 2</span> * Runner
<span class='line'> 3</span> *
<span class='line'> 4</span> * @constructor
<span class='line'> 5</span> * @param {jasmine.Env} env
<span class='line'> 6</span> */</span><span class="WHIT">
<span class='line'> 7</span> </span><span class="NAME">jasmine.Runner</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">env</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 8</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 9</span> </span><span class="WHIT"> </span><span class="NAME">self.env</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">env</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="NAME">self.queue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Queue</span><span class="PUNC">(</span><span class="NAME">env</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="NAME">self.before_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="NAME">self.after_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="NAME">self.suites_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 15</span>
<span class='line'> 16</span> </span><span class="NAME">jasmine.Runner.prototype.execute</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">self.env.reporter.reportRunnerStarting</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="NAME">self.env.reporter.reportRunnerStarting</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="NAME">self.queue.start</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="NAME">self.finishCallback</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 25</span>
<span class='line'> 26</span> </span><span class="NAME">jasmine.Runner.prototype.beforeEach</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">beforeEachFunction</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="NAME">beforeEachFunction.typeName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'beforeEach'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="NAME">this.before_.push</span><span class="PUNC">(</span><span class="NAME">beforeEachFunction</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 30</span>
<span class='line'> 31</span> </span><span class="NAME">jasmine.Runner.prototype.afterEach</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">afterEachFunction</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="NAME">afterEachFunction.typeName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'afterEach'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="NAME">this.after_.push</span><span class="PUNC">(</span><span class="NAME">afterEachFunction</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 35</span>
<span class='line'> 36</span>
<span class='line'> 37</span> </span><span class="NAME">jasmine.Runner.prototype.finishCallback</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="NAME">this.env.reporter.reportRunnerResults</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 40</span>
<span class='line'> 41</span> </span><span class="NAME">jasmine.Runner.prototype.addSuite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">suite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="NAME">this.suites_.push</span><span class="PUNC">(</span><span class="NAME">suite</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 44</span>
<span class='line'> 45</span> </span><span class="NAME">jasmine.Runner.prototype.add</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">block</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">jasmine.Suite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="NAME">this.addSuite</span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="NAME">this.queue.add</span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 51</span>
<span class='line'> 52</span> </span><span class="NAME">jasmine.Runner.prototype.specs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">suites</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.suites</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">specs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">suites.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="NAME">specs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">specs.concat</span><span class="PUNC">(</span><span class="NAME">suites</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">specs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">specs</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 60</span>
<span class='line'> 61</span>
<span class='line'> 62</span> </span><span class="NAME">jasmine.Runner.prototype.suites</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.suites_</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 65</span>
<span class='line'> 66</span> </span><span class="NAME">jasmine.Runner.prototype.results</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.queue.results</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="PUNC">}</span><span class="PUNC">;</span></pre></body></html>

View File

@ -1,211 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
<span class='line'> 2</span> * Internal representation of a Jasmine specification, or test.
<span class='line'> 3</span> *
<span class='line'> 4</span> * @constructor
<span class='line'> 5</span> * @param {jasmine.Env} env
<span class='line'> 6</span> * @param {jasmine.Suite} suite
<span class='line'> 7</span> * @param {String} description
<span class='line'> 8</span> */</span><span class="WHIT">
<span class='line'> 9</span> </span><span class="NAME">jasmine.Spec</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">description</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">env</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">'jasmine.Env() required'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">suite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">'jasmine.Suite() required'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="NAME">spec.id</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">env.nextSpecId</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">env.nextSpecId</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="NAME">spec.env</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">env</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="NAME">spec.suite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="WHIT"> </span><span class="NAME">spec.description</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">description</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="NAME">spec.queue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Queue</span><span class="PUNC">(</span><span class="NAME">env</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 22</span>
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="NAME">spec.afterCallbacks</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="NAME">spec.spies_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 25</span>
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="NAME">spec.results_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.NestedResults</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="NAME">spec.results_.description</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">description</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="NAME">spec.matchersClass</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 30</span>
<span class='line'> 31</span> </span><span class="NAME">jasmine.Spec.prototype.getFullName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.suite.getFullName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.description</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 34</span>
<span class='line'> 35</span>
<span class='line'> 36</span> </span><span class="NAME">jasmine.Spec.prototype.results</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.results_</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 39</span>
<span class='line'> 40</span> </span><span class="NAME">jasmine.Spec.prototype.log</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.results_.log</span><span class="PUNC">(</span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 43</span>
<span class='line'> 44</span> </span><span class="COMM">/** @deprecated */</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="NAME">jasmine.Spec.prototype.getResults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.results_</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span>
<span class='line'> 49</span> </span><span class="NAME">jasmine.Spec.prototype.runs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">func</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">block</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Block</span><span class="PUNC">(</span><span class="NAME">this.env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">func</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="NAME">this.addToQueue</span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 54</span>
<span class='line'> 55</span> </span><span class="NAME">jasmine.Spec.prototype.addToQueue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.queue.isRunning</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="NAME">this.queue.insertNext</span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="NAME">this.queue.add</span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 62</span>
<span class='line'> 63</span> </span><span class="NAME">jasmine.Spec.prototype.addMatcherResult</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">this.results_.addResult</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 66</span>
<span class='line'> 67</span> </span><span class="NAME">jasmine.Spec.prototype.expect</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.getMatchersClass_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="NAME">this.env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">actual</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 70</span>
<span class='line'> 71</span> </span><span class="NAME">jasmine.Spec.prototype.waits</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeout</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">waitsFunc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.WaitsBlock</span><span class="PUNC">(</span><span class="NAME">this.env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">timeout</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="NAME">this.addToQueue</span><span class="PUNC">(</span><span class="NAME">waitsFunc</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 76</span>
<span class='line'> 77</span> </span><span class="NAME">jasmine.Spec.prototype.waitsFor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeout</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">latchFunction</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">timeoutMessage</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">waitsForFunc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.WaitsForBlock</span><span class="PUNC">(</span><span class="NAME">this.env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">timeout</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">latchFunction</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">timeoutMessage</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="NAME">this.addToQueue</span><span class="PUNC">(</span><span class="NAME">waitsForFunc</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 82</span>
<span class='line'> 83</span> </span><span class="NAME">jasmine.Spec.prototype.fail</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">expectationResult</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.ExpectationResult</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="NAME">passed</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">jasmine.util.formatException</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'Exception'</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT"> </span><span class="NAME">this.results_.addResult</span><span class="PUNC">(</span><span class="NAME">expectationResult</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 90</span>
<span class='line'> 91</span> </span><span class="NAME">jasmine.Spec.prototype.getMatchersClass_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.matchersClass</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">this.env.matchersClass</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 94</span>
<span class='line'> 95</span> </span><span class="NAME">jasmine.Spec.prototype.addMatchers</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">matchersPrototype</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">parent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getMatchersClass_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">newMatchersClass</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="NAME">parent.apply</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.util.inherit</span><span class="PUNC">(</span><span class="NAME">newMatchersClass</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">parent</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.wrapInto_</span><span class="PUNC">(</span><span class="NAME">matchersPrototype</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">newMatchersClass</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="NAME">this.matchersClass</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">newMatchersClass</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>103</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>104</span>
<span class='line'>105</span> </span><span class="NAME">jasmine.Spec.prototype.finishCallback</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="NAME">this.env.reporter.reportSpecResults</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>107</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>108</span>
<span class='line'>109</span> </span><span class="NAME">jasmine.Spec.prototype.finish</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">onComplete</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="NAME">this.removeAllSpies</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT"> </span><span class="NAME">this.finishCallback</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">onComplete</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT"> </span><span class="NAME">onComplete</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>115</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>116</span>
<span class='line'>117</span> </span><span class="NAME">jasmine.Spec.prototype.after</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">doAfter</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">test</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>118</span>
<span class='line'>119</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.queue.isRunning</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT"> </span><span class="NAME">this.queue.add</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Block</span><span class="PUNC">(</span><span class="NAME">this.env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">doAfter</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>122</span> </span><span class="WHIT"> </span><span class="NAME">this.afterCallbacks.unshift</span><span class="PUNC">(</span><span class="NAME">doAfter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>123</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>124</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>125</span>
<span class='line'>126</span> </span><span class="NAME">jasmine.Spec.prototype.execute</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">onComplete</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>127</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>128</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">spec.env.specFilter</span><span class="PUNC">(</span><span class="NAME">spec</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>129</span> </span><span class="WHIT"> </span><span class="NAME">spec.results_.skipped</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>130</span> </span><span class="WHIT"> </span><span class="NAME">spec.finish</span><span class="PUNC">(</span><span class="NAME">onComplete</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>131</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>132</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="NAME">this.env.reporter.log</span><span class="PUNC">(</span><span class="STRN">'>> Jasmine Running '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.suite.description</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.description</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'...'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>134</span>
<span class='line'>135</span> </span><span class="WHIT"> </span><span class="NAME">spec.env.currentSpec</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>136</span>
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="NAME">spec.addBeforesAndAftersToQueue</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>138</span>
<span class='line'>139</span> </span><span class="WHIT"> </span><span class="NAME">spec.queue.start</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>140</span> </span><span class="WHIT"> </span><span class="NAME">spec.finish</span><span class="PUNC">(</span><span class="NAME">onComplete</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>141</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>142</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>143</span>
<span class='line'>144</span> </span><span class="NAME">jasmine.Spec.prototype.addBeforesAndAftersToQueue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">runner</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.env.currentRunner</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>146</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.suite</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">suite.parentSuite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>147</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">suite.before_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>148</span> </span><span class="WHIT"> </span><span class="NAME">this.queue.addBefore</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Block</span><span class="PUNC">(</span><span class="NAME">this.env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">suite.before_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>149</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>150</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>151</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">runner.before_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>152</span> </span><span class="WHIT"> </span><span class="NAME">this.queue.addBefore</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Block</span><span class="PUNC">(</span><span class="NAME">this.env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">runner.before_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>153</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>154</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">this.afterCallbacks.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>155</span> </span><span class="WHIT"> </span><span class="NAME">this.queue.add</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Block</span><span class="PUNC">(</span><span class="NAME">this.env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.afterCallbacks</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>156</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>157</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">suite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.suite</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">suite.parentSuite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>158</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">suite.after_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>159</span> </span><span class="WHIT"> </span><span class="NAME">this.queue.add</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Block</span><span class="PUNC">(</span><span class="NAME">this.env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">suite.after_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>160</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>161</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>162</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">runner.after_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>163</span> </span><span class="WHIT"> </span><span class="NAME">this.queue.add</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Block</span><span class="PUNC">(</span><span class="NAME">this.env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">runner.after_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>164</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>165</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>166</span>
<span class='line'>167</span> </span><span class="NAME">jasmine.Spec.prototype.explodes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>168</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">'explodes function should not have been called'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>169</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>170</span>
<span class='line'>171</span> </span><span class="NAME">jasmine.Spec.prototype.spyOn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">methodName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ignoreMethodDoesntExist</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>172</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">obj</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">jasmine.undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"spyOn could not find an object to spy upon for "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">methodName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"()"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>174</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>175</span>
<span class='line'>176</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">ignoreMethodDoesntExist</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">methodName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">jasmine.undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>177</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="NAME">methodName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'() method does not exist'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>178</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>179</span>
<span class='line'>180</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">ignoreMethodDoesntExist</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">methodName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">methodName</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">isSpy</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>181</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="NAME">methodName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' has already been spied upon'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>182</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>183</span>
<span class='line'>184</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spyObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.createSpy</span><span class="PUNC">(</span><span class="NAME">methodName</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>185</span>
<span class='line'>186</span> </span><span class="WHIT"> </span><span class="NAME">this.spies_.push</span><span class="PUNC">(</span><span class="NAME">spyObj</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>187</span> </span><span class="WHIT"> </span><span class="NAME">spyObj.baseObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>188</span> </span><span class="WHIT"> </span><span class="NAME">spyObj.methodName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">methodName</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>189</span> </span><span class="WHIT"> </span><span class="NAME">spyObj.originalValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">methodName</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>190</span>
<span class='line'>191</span> </span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">methodName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">spyObj</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>192</span>
<span class='line'>193</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">spyObj</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>194</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>195</span>
<span class='line'>196</span> </span><span class="NAME">jasmine.Spec.prototype.removeAllSpies</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>197</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">this.spies_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>198</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.spies_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>199</span> </span><span class="WHIT"> </span><span class="NAME">spy.baseObj</span><span class="PUNC">[</span><span class="NAME">spy.methodName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">spy.originalValue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>200</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>201</span> </span><span class="WHIT"> </span><span class="NAME">this.spies_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>202</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>203</span>
<span class='line'>204</span> </span></pre></body></html>

View File

@ -1,77 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
<span class='line'> 2</span> * Internal representation of a Jasmine suite.
<span class='line'> 3</span> *
<span class='line'> 4</span> * @constructor
<span class='line'> 5</span> * @param {jasmine.Env} env
<span class='line'> 6</span> * @param {String} description
<span class='line'> 7</span> * @param {Function} specDefinitions
<span class='line'> 8</span> * @param {jasmine.Suite} parentSuite
<span class='line'> 9</span> */</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="NAME">jasmine.Suite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">description</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">specDefinitions</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">parentSuite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="NAME">self.id</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">env.nextSuiteId</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">env.nextSuiteId</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="NAME">self.description</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">description</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="NAME">self.queue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Queue</span><span class="PUNC">(</span><span class="NAME">env</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="NAME">self.parentSuite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parentSuite</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="NAME">self.env</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">env</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="NAME">self.before_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="NAME">self.after_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="NAME">self.specs_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 21</span>
<span class='line'> 22</span> </span><span class="NAME">jasmine.Suite.prototype.getFullName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">fullName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.description</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">parentSuite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.parentSuite</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">parentSuite</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">parentSuite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parentSuite.parentSuite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="NAME">fullName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parentSuite.description</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">fullName</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">fullName</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 29</span>
<span class='line'> 30</span> </span><span class="NAME">jasmine.Suite.prototype.finish</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">onComplete</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="NAME">this.env.reporter.reportSuiteResults</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="NAME">this.finished</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">onComplete</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="NAME">onComplete</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 37</span>
<span class='line'> 38</span> </span><span class="NAME">jasmine.Suite.prototype.beforeEach</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">beforeEachFunction</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="NAME">beforeEachFunction.typeName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'beforeEach'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT"> </span><span class="NAME">this.before_.push</span><span class="PUNC">(</span><span class="NAME">beforeEachFunction</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 42</span>
<span class='line'> 43</span> </span><span class="NAME">jasmine.Suite.prototype.afterEach</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">afterEachFunction</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="NAME">afterEachFunction.typeName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'afterEach'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="NAME">this.after_.push</span><span class="PUNC">(</span><span class="NAME">afterEachFunction</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 47</span>
<span class='line'> 48</span> </span><span class="NAME">jasmine.Suite.prototype.results</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.queue.results</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 51</span>
<span class='line'> 52</span> </span><span class="NAME">jasmine.Suite.prototype.add</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">block</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">jasmine.Suite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="NAME">this.env.currentRunner</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addSuite</span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="NAME">this.specs_.push</span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="NAME">this.queue.add</span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 60</span>
<span class='line'> 61</span> </span><span class="NAME">jasmine.Suite.prototype.specs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.specs_</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 64</span>
<span class='line'> 65</span> </span><span class="NAME">jasmine.Suite.prototype.execute</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">onComplete</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="NAME">this.queue.start</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="NAME">self.finish</span><span class="PUNC">(</span><span class="NAME">onComplete</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="PUNC">}</span><span class="PUNC">;</span></pre></body></html>

View File

@ -1,21 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="NAME">jasmine.WaitsBlock</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">timeout</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 2</span> </span><span class="WHIT"> </span><span class="NAME">this.timeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">timeout</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 3</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Block.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 4</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 5</span>
<span class='line'> 6</span> </span><span class="NAME">jasmine.util.inherit</span><span class="PUNC">(</span><span class="NAME">jasmine.WaitsBlock</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">jasmine.Block</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 7</span>
<span class='line'> 8</span> </span><span class="NAME">jasmine.WaitsBlock.prototype.execute</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">onComplete</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 9</span> </span><span class="WHIT"> </span><span class="NAME">this.env.reporter.log</span><span class="PUNC">(</span><span class="STRN">'>> Jasmine waiting for '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.timeout</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' ms...'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="NAME">this.env.setTimeout</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="NAME">onComplete</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.timeout</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 13</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 14</span> </span></pre></body></html>

View File

@ -1,45 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="NAME">jasmine.WaitsForBlock</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">timeout</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">latchFunction</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 2</span> </span><span class="WHIT"> </span><span class="NAME">this.timeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">timeout</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 3</span> </span><span class="WHIT"> </span><span class="NAME">this.latchFunction</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">latchFunction</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 4</span> </span><span class="WHIT"> </span><span class="NAME">this.message</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 5</span> </span><span class="WHIT"> </span><span class="NAME">this.totalTimeSpentWaitingForLatch</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 6</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Block.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 7</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 8</span>
<span class='line'> 9</span> </span><span class="NAME">jasmine.util.inherit</span><span class="PUNC">(</span><span class="NAME">jasmine.WaitsForBlock</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">jasmine.Block</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 10</span>
<span class='line'> 11</span> </span><span class="NAME">jasmine.WaitsForBlock.TIMEOUT_INCREMENT</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">100</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 12</span>
<span class='line'> 13</span> </span><span class="NAME">jasmine.WaitsForBlock.prototype.execute</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">onComplete</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="NAME">self.env.reporter.log</span><span class="PUNC">(</span><span class="STRN">'>> Jasmine waiting for '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">self.message</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">'something to happen'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">latchFunctionResult</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="NAME">latchFunctionResult</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.latchFunction.apply</span><span class="PUNC">(</span><span class="NAME">self.spec</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="WHIT"> </span><span class="NAME">self.spec.fail</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="NAME">onComplete</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 24</span>
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">latchFunctionResult</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="NAME">onComplete</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">self.totalTimeSpentWaitingForLatch</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">self.timeout</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">message</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'timed out after '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">self.timeout</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' msec waiting for '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">self.message</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">'something to happen'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="NAME">self.spec.fail</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'timeout'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">message</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="NAME">self.spec._next</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="NAME">self.totalTimeSpentWaitingForLatch</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.WaitsForBlock.TIMEOUT_INCREMENT</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="NAME">self.env.setTimeout</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">self.execute</span><span class="PUNC">(</span><span class="NAME">onComplete</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">jasmine.WaitsForBlock.TIMEOUT_INCREMENT</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="PUNC">}</span><span class="PUNC">;</span></pre></body></html>

View File

@ -1,555 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
<span class='line'> 2</span> * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
<span class='line'> 3</span> *
<span class='line'> 4</span> * @namespace
<span class='line'> 5</span> */</span><span class="WHIT">
<span class='line'> 6</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">jasmine</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 7</span>
<span class='line'> 8</span> </span><span class="COMM">/**
<span class='line'> 9</span> * @private
<span class='line'> 10</span> */</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="NAME">jasmine.unimplementedMethod_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"unimplemented method"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 13</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 14</span>
<span class='line'> 15</span> </span><span class="COMM">/**
<span class='line'> 16</span> * Use &lt;code>jasmine.undefined&lt;/code> instead of &lt;code>undefined&lt;/code>, since &lt;code>undefined&lt;/code is just
<span class='line'> 17</span> * a plain old variable and may be redefined by somebody else.
<span class='line'> 18</span> *
<span class='line'> 19</span> * @private
<span class='line'> 20</span> */</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="NAME">jasmine.undefined</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.___undefined___</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 22</span>
<span class='line'> 23</span> </span><span class="COMM">/**
<span class='line'> 24</span> * Default interval for event loop yields. Small values here may result in slow test running. Zero means no updates until all tests have completed.
<span class='line'> 25</span> *
<span class='line'> 26</span> */</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="NAME">jasmine.DEFAULT_UPDATE_INTERVAL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">250</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 28</span>
<span class='line'> 29</span> </span><span class="COMM">/**
<span class='line'> 30</span> * Allows for bound functions to be compared. Internal use only.
<span class='line'> 31</span> *
<span class='line'> 32</span> * @ignore
<span class='line'> 33</span> * @private
<span class='line'> 34</span> * @param base {Object} bound 'this' for the function
<span class='line'> 35</span> * @param name {Function} function to find
<span class='line'> 36</span> */</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="NAME">jasmine.bindOriginal_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">base</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">original</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">base</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">original.apply</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">original.apply</span><span class="PUNC">(</span><span class="NAME">base</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="COMM">// IE support</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">window</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span>
<span class='line'> 49</span> </span><span class="NAME">jasmine.setTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.bindOriginal_</span><span class="PUNC">(</span><span class="NAME">window</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'setTimeout'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="NAME">jasmine.clearTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.bindOriginal_</span><span class="PUNC">(</span><span class="NAME">window</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'clearTimeout'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="NAME">jasmine.setInterval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.bindOriginal_</span><span class="PUNC">(</span><span class="NAME">window</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'setInterval'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="NAME">jasmine.clearInterval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.bindOriginal_</span><span class="PUNC">(</span><span class="NAME">window</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'clearInterval'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 53</span>
<span class='line'> 54</span> </span><span class="NAME">jasmine.MessageResult</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">text</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'MessageResult'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="NAME">this.text</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="NAME">this.trace</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// todo: test better</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 59</span>
<span class='line'> 60</span> </span><span class="NAME">jasmine.ExpectationResult</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'ExpectationResult'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="NAME">this.matcherName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params.matcherName</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="NAME">this.passed_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params.passed</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">this.expected</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params.expected</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="NAME">this.actual</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params.actual</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 66</span>
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="COMM">/** @deprecated */</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="NAME">this.details</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params.details</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT">
<span class='line'> 70</span> </span><span class="NAME">this.message</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.passed_</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'Passed.'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">params.message</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="NAME">this.trace</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.passed_</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="NAME">this.message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 73</span>
<span class='line'> 74</span> </span><span class="NAME">jasmine.ExpectationResult.prototype.passed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.passed_</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 77</span>
<span class='line'> 78</span> </span><span class="COMM">/**
<span class='line'> 79</span> * Getter for the Jasmine environment. Ensures one gets created
<span class='line'> 80</span> */</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="NAME">jasmine.getEnv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.currentEnv_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.currentEnv_</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Env</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 84</span>
<span class='line'> 85</span> </span><span class="COMM">/**
<span class='line'> 86</span> * @ignore
<span class='line'> 87</span> * @private
<span class='line'> 88</span> * @param value
<span class='line'> 89</span> * @returns {Boolean}
<span class='line'> 90</span> */</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="NAME">jasmine.isArray_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value.length</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'number'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value.splice</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT"> </span><span class="PUNC">!</span><span class="PUNC">(</span><span class="NAME">value.propertyIsEnumerable</span><span class="PUNC">(</span><span class="STRN">'length'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 98</span>
<span class='line'> 99</span> </span><span class="COMM">/**
<span class='line'>100</span> * Pretty printer for expecations. Takes any object and turns it into a human-readable string.
<span class='line'>101</span> *
<span class='line'>102</span> * @param value {Object} an object to be outputted
<span class='line'>103</span> * @returns {String}
<span class='line'>104</span> */</span><span class="WHIT">
<span class='line'>105</span> </span><span class="NAME">jasmine.pp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">stringPrettyPrinter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.StringPrettyPrinter</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>107</span> </span><span class="WHIT"> </span><span class="NAME">stringPrettyPrinter.format</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">stringPrettyPrinter.string</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>109</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>110</span>
<span class='line'>111</span> </span><span class="COMM">/**
<span class='line'>112</span> * Returns true if the object is a DOM Node.
<span class='line'>113</span> *
<span class='line'>114</span> * @param {Object} obj object to check
<span class='line'>115</span> * @returns {Boolean}
<span class='line'>116</span> */</span><span class="WHIT">
<span class='line'>117</span> </span><span class="NAME">jasmine.isDomNode</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>118</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="STRN">'nodeType'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>119</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>120</span>
<span class='line'>121</span> </span><span class="COMM">/**
<span class='line'>122</span> * Returns a matchable 'generic' object of the class type. For use in expecations of type when values don't matter.
<span class='line'>123</span> *
<span class='line'>124</span> * @example
<span class='line'>125</span> * // don't care about which function is passed in, as long as it's a function
<span class='line'>126</span> * expect(mySpy).wasCalledWith(jasmine.any(Function));
<span class='line'>127</span> *
<span class='line'>128</span> * @param {Class} clazz
<span class='line'>129</span> * @returns matchable object of the type clazz
<span class='line'>130</span> */</span><span class="WHIT">
<span class='line'>131</span> </span><span class="NAME">jasmine.any</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">clazz</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>132</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.Any</span><span class="PUNC">(</span><span class="NAME">clazz</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>133</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>134</span>
<span class='line'>135</span> </span><span class="COMM">/**
<span class='line'>136</span> * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks.
<span class='line'>137</span> *
<span class='line'>138</span> * Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmine
<span class='line'>139</span> * expectation syntax. Spies can be checked if they were called or not and what the calling params were.
<span class='line'>140</span> *
<span class='line'>141</span> * A Spy has the following mehtod: wasCalled, callCount, mostRecentCall, and argsForCall (see docs)
<span class='line'>142</span> * Spies are torn down at the end of every spec.
<span class='line'>143</span> *
<span class='line'>144</span> * Note: Do &lt;b>not&lt;/b> call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj.
<span class='line'>145</span> *
<span class='line'>146</span> * @example
<span class='line'>147</span> * // a stub
<span class='line'>148</span> * var myStub = jasmine.createSpy('myStub'); // can be used anywhere
<span class='line'>149</span> *
<span class='line'>150</span> * // spy example
<span class='line'>151</span> * var foo = {
<span class='line'>152</span> * not: function(bool) { return !bool; }
<span class='line'>153</span> * }
<span class='line'>154</span> *
<span class='line'>155</span> * // actual foo.not will not be called, execution stops
<span class='line'>156</span> * spyOn(foo, 'not');
<span class='line'>157</span>
<span class='line'>158</span> // foo.not spied upon, execution will continue to implementation
<span class='line'>159</span> * spyOn(foo, 'not').andCallThrough();
<span class='line'>160</span> *
<span class='line'>161</span> * // fake example
<span class='line'>162</span> * var foo = {
<span class='line'>163</span> * not: function(bool) { return !bool; }
<span class='line'>164</span> * }
<span class='line'>165</span> *
<span class='line'>166</span> * // foo.not(val) will return val
<span class='line'>167</span> * spyOn(foo, 'not').andCallFake(function(value) {return value;});
<span class='line'>168</span> *
<span class='line'>169</span> * // mock example
<span class='line'>170</span> * foo.not(7 == 7);
<span class='line'>171</span> * expect(foo.not).wasCalled();
<span class='line'>172</span> * expect(foo.not).wasCalledWith(true);
<span class='line'>173</span> *
<span class='line'>174</span> * @constructor
<span class='line'>175</span> * @see spyOn, jasmine.createSpy, jasmine.createSpyObj
<span class='line'>176</span> * @param {String} name
<span class='line'>177</span> */</span><span class="WHIT">
<span class='line'>178</span> </span><span class="NAME">jasmine.Spy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>179</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>180</span> * The name of the spy, if provided.
<span class='line'>181</span> */</span><span class="WHIT">
<span class='line'>182</span> </span><span class="WHIT"> </span><span class="NAME">this.identity</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">'unknown'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>183</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>184</span> * Is this Object a spy?
<span class='line'>185</span> */</span><span class="WHIT">
<span class='line'>186</span> </span><span class="WHIT"> </span><span class="NAME">this.isSpy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>187</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>188</span> * The actual function this spy stubs.
<span class='line'>189</span> */</span><span class="WHIT">
<span class='line'>190</span> </span><span class="WHIT"> </span><span class="NAME">this.plan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>193</span> * Tracking of the most recent call to the spy.
<span class='line'>194</span> * @example
<span class='line'>195</span> * var mySpy = jasmine.createSpy('foo');
<span class='line'>196</span> * mySpy(1, 2);
<span class='line'>197</span> * mySpy.mostRecentCall.args = [1, 2];
<span class='line'>198</span> */</span><span class="WHIT">
<span class='line'>199</span> </span><span class="WHIT"> </span><span class="NAME">this.mostRecentCall</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>200</span>
<span class='line'>201</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>202</span> * Holds arguments for each call to the spy, indexed by call count
<span class='line'>203</span> * @example
<span class='line'>204</span> * var mySpy = jasmine.createSpy('foo');
<span class='line'>205</span> * mySpy(1, 2);
<span class='line'>206</span> * mySpy(7, 8);
<span class='line'>207</span> * mySpy.mostRecentCall.args = [7, 8];
<span class='line'>208</span> * mySpy.argsForCall[0] = [1, 2];
<span class='line'>209</span> * mySpy.argsForCall[1] = [7, 8];
<span class='line'>210</span> */</span><span class="WHIT">
<span class='line'>211</span> </span><span class="WHIT"> </span><span class="NAME">this.argsForCall</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>212</span> </span><span class="WHIT"> </span><span class="NAME">this.calls</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>213</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>214</span>
<span class='line'>215</span> </span><span class="COMM">/**
<span class='line'>216</span> * Tells a spy to call through to the actual implemenatation.
<span class='line'>217</span> *
<span class='line'>218</span> * @example
<span class='line'>219</span> * var foo = {
<span class='line'>220</span> * bar: function() { // do some stuff }
<span class='line'>221</span> * }
<span class='line'>222</span> *
<span class='line'>223</span> * // defining a spy on an existing property: foo.bar
<span class='line'>224</span> * spyOn(foo, 'bar').andCallThrough();
<span class='line'>225</span> */</span><span class="WHIT">
<span class='line'>226</span> </span><span class="NAME">jasmine.Spy.prototype.andCallThrough</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT"> </span><span class="NAME">this.plan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.originalValue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>228</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>229</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>230</span>
<span class='line'>231</span> </span><span class="COMM">/**
<span class='line'>232</span> * For setting the return value of a spy.
<span class='line'>233</span> *
<span class='line'>234</span> * @example
<span class='line'>235</span> * // defining a spy from scratch: foo() returns 'baz'
<span class='line'>236</span> * var foo = jasmine.createSpy('spy on foo').andReturn('baz');
<span class='line'>237</span> *
<span class='line'>238</span> * // defining a spy on an existing property: foo.bar() returns 'baz'
<span class='line'>239</span> * spyOn(foo, 'bar').andReturn('baz');
<span class='line'>240</span> *
<span class='line'>241</span> * @param {Object} value
<span class='line'>242</span> */</span><span class="WHIT">
<span class='line'>243</span> </span><span class="NAME">jasmine.Spy.prototype.andReturn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>244</span> </span><span class="WHIT"> </span><span class="NAME">this.plan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>245</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>246</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>247</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>248</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>249</span>
<span class='line'>250</span> </span><span class="COMM">/**
<span class='line'>251</span> * For throwing an exception when a spy is called.
<span class='line'>252</span> *
<span class='line'>253</span> * @example
<span class='line'>254</span> * // defining a spy from scratch: foo() throws an exception w/ message 'ouch'
<span class='line'>255</span> * var foo = jasmine.createSpy('spy on foo').andThrow('baz');
<span class='line'>256</span> *
<span class='line'>257</span> * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch'
<span class='line'>258</span> * spyOn(foo, 'bar').andThrow('baz');
<span class='line'>259</span> *
<span class='line'>260</span> * @param {String} exceptionMsg
<span class='line'>261</span> */</span><span class="WHIT">
<span class='line'>262</span> </span><span class="NAME">jasmine.Spy.prototype.andThrow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">exceptionMsg</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>263</span> </span><span class="WHIT"> </span><span class="NAME">this.plan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>264</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="NAME">exceptionMsg</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>265</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>266</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>267</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>268</span>
<span class='line'>269</span> </span><span class="COMM">/**
<span class='line'>270</span> * Calls an alternate implementation when a spy is called.
<span class='line'>271</span> *
<span class='line'>272</span> * @example
<span class='line'>273</span> * var baz = function() {
<span class='line'>274</span> * // do some stuff, return something
<span class='line'>275</span> * }
<span class='line'>276</span> * // defining a spy from scratch: foo() calls the function baz
<span class='line'>277</span> * var foo = jasmine.createSpy('spy on foo').andCall(baz);
<span class='line'>278</span> *
<span class='line'>279</span> * // defining a spy on an existing property: foo.bar() calls an anonymnous function
<span class='line'>280</span> * spyOn(foo, 'bar').andCall(function() { return 'baz';} );
<span class='line'>281</span> *
<span class='line'>282</span> * @param {Function} fakeFunc
<span class='line'>283</span> */</span><span class="WHIT">
<span class='line'>284</span> </span><span class="NAME">jasmine.Spy.prototype.andCallFake</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">fakeFunc</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT"> </span><span class="NAME">this.plan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">fakeFunc</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>287</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>288</span>
<span class='line'>289</span> </span><span class="COMM">/**
<span class='line'>290</span> * Resets all of a spy's the tracking variables so that it can be used again.
<span class='line'>291</span> *
<span class='line'>292</span> * @example
<span class='line'>293</span> * spyOn(foo, 'bar');
<span class='line'>294</span> *
<span class='line'>295</span> * foo.bar();
<span class='line'>296</span> *
<span class='line'>297</span> * expect(foo.bar.callCount).toEqual(1);
<span class='line'>298</span> *
<span class='line'>299</span> * foo.bar.reset();
<span class='line'>300</span> *
<span class='line'>301</span> * expect(foo.bar.callCount).toEqual(0);
<span class='line'>302</span> */</span><span class="WHIT">
<span class='line'>303</span> </span><span class="NAME">jasmine.Spy.prototype.reset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>304</span> </span><span class="WHIT"> </span><span class="NAME">this.wasCalled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>305</span> </span><span class="WHIT"> </span><span class="NAME">this.callCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>306</span> </span><span class="WHIT"> </span><span class="NAME">this.argsForCall</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>307</span> </span><span class="WHIT"> </span><span class="NAME">this.calls</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>308</span> </span><span class="WHIT"> </span><span class="NAME">this.mostRecentCall</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>309</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>310</span>
<span class='line'>311</span> </span><span class="NAME">jasmine.createSpy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>312</span>
<span class='line'>313</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spyObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>314</span> </span><span class="WHIT"> </span><span class="NAME">spyObj.wasCalled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>315</span> </span><span class="WHIT"> </span><span class="NAME">spyObj.callCount</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>316</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">args</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.util.argsToArray</span><span class="PUNC">(</span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>317</span> </span><span class="WHIT"> </span><span class="NAME">spyObj.mostRecentCall.object</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>318</span> </span><span class="WHIT"> </span><span class="NAME">spyObj.mostRecentCall.args</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>319</span> </span><span class="WHIT"> </span><span class="NAME">spyObj.argsForCall.push</span><span class="PUNC">(</span><span class="NAME">args</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>320</span> </span><span class="WHIT"> </span><span class="NAME">spyObj.calls.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">object</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>321</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">spyObj.plan.apply</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>322</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>323</span>
<span class='line'>324</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Spy</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>325</span>
<span class='line'>326</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">prop</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">spy</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>327</span> </span><span class="WHIT"> </span><span class="NAME">spyObj</span><span class="PUNC">[</span><span class="NAME">prop</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">spy</span><span class="PUNC">[</span><span class="NAME">prop</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>328</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>329</span>
<span class='line'>330</span> </span><span class="WHIT"> </span><span class="NAME">spyObj.reset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>331</span>
<span class='line'>332</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">spyObj</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>333</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>334</span>
<span class='line'>335</span> </span><span class="COMM">/**
<span class='line'>336</span> * Determines whether an object is a spy.
<span class='line'>337</span> *
<span class='line'>338</span> * @param {jasmine.Spy|Object} putativeSpy
<span class='line'>339</span> * @returns {Boolean}
<span class='line'>340</span> */</span><span class="WHIT">
<span class='line'>341</span> </span><span class="NAME">jasmine.isSpy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">putativeSpy</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>342</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">putativeSpy</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">putativeSpy.isSpy</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>343</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>344</span>
<span class='line'>345</span> </span><span class="COMM">/**
<span class='line'>346</span> * Creates a more complicated spy: an Object that has every property a function that is a spy. Used for stubbing something
<span class='line'>347</span> * large in one call.
<span class='line'>348</span> *
<span class='line'>349</span> * @param {String} baseName name of spy class
<span class='line'>350</span> * @param {Array} methodNames array of names of methods to make spies
<span class='line'>351</span> */</span><span class="WHIT">
<span class='line'>352</span> </span><span class="NAME">jasmine.createSpyObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">baseName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">methodNames</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>353</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>354</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">methodNames.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>355</span> </span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">methodNames</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.createSpy</span><span class="PUNC">(</span><span class="NAME">baseName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">methodNames</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>356</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>357</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>358</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>359</span>
<span class='line'>360</span> </span><span class="NAME">jasmine.log</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>361</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">currentSpec.log</span><span class="PUNC">(</span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>362</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>363</span>
<span class='line'>364</span> </span><span class="COMM">/**
<span class='line'>365</span> * Function that installs a spy on an existing object's method name. Used within a Spec to create a spy.
<span class='line'>366</span> *
<span class='line'>367</span> * @example
<span class='line'>368</span> * // spy example
<span class='line'>369</span> * var foo = {
<span class='line'>370</span> * not: function(bool) { return !bool; }
<span class='line'>371</span> * }
<span class='line'>372</span> * spyOn(foo, 'not'); // actual foo.not will not be called, execution stops
<span class='line'>373</span> *
<span class='line'>374</span> * @see jasmine.createSpy
<span class='line'>375</span> * @param obj
<span class='line'>376</span> * @param methodName
<span class='line'>377</span> * @returns a Jasmine spy that can be chained with all spy methods
<span class='line'>378</span> */</span><span class="WHIT">
<span class='line'>379</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spyOn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">methodName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>380</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">currentSpec.spyOn</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">methodName</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>381</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>382</span>
<span class='line'>383</span> </span><span class="COMM">/**
<span class='line'>384</span> * Creates a Jasmine spec that will be added to the current suite.
<span class='line'>385</span> *
<span class='line'>386</span> * // TODO: pending tests
<span class='line'>387</span> *
<span class='line'>388</span> * @example
<span class='line'>389</span> * it('should be true', function() {
<span class='line'>390</span> * expect(true).toEqual(true);
<span class='line'>391</span> * });
<span class='line'>392</span> *
<span class='line'>393</span> * @param {String} desc description of this specification
<span class='line'>394</span> * @param {Function} func defines the preconditions and expectations of the spec
<span class='line'>395</span> */</span><span class="WHIT">
<span class='line'>396</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">it</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">desc</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">func</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>397</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">it</span><span class="PUNC">(</span><span class="NAME">desc</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">func</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>398</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>399</span>
<span class='line'>400</span> </span><span class="COMM">/**
<span class='line'>401</span> * Creates a &lt;em>disabled&lt;/em> Jasmine spec.
<span class='line'>402</span> *
<span class='line'>403</span> * A convenience method that allows existing specs to be disabled temporarily during development.
<span class='line'>404</span> *
<span class='line'>405</span> * @param {String} desc description of this specification
<span class='line'>406</span> * @param {Function} func defines the preconditions and expectations of the spec
<span class='line'>407</span> */</span><span class="WHIT">
<span class='line'>408</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xit</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">desc</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">func</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>409</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">xit</span><span class="PUNC">(</span><span class="NAME">desc</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">func</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>410</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>411</span>
<span class='line'>412</span> </span><span class="COMM">/**
<span class='line'>413</span> * Starts a chain for a Jasmine expectation.
<span class='line'>414</span> *
<span class='line'>415</span> * It is passed an Object that is the actual value and should chain to one of the many
<span class='line'>416</span> * jasmine.Matchers functions.
<span class='line'>417</span> *
<span class='line'>418</span> * @param {Object} actual Actual value to test against and expected value
<span class='line'>419</span> */</span><span class="WHIT">
<span class='line'>420</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">expect</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>421</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">currentSpec.expect</span><span class="PUNC">(</span><span class="NAME">actual</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>422</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>423</span>
<span class='line'>424</span> </span><span class="COMM">/**
<span class='line'>425</span> * Defines part of a jasmine spec. Used in cominbination with waits or waitsFor in asynchrnous specs.
<span class='line'>426</span> *
<span class='line'>427</span> * @param {Function} func Function that defines part of a jasmine spec.
<span class='line'>428</span> */</span><span class="WHIT">
<span class='line'>429</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">runs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">func</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>430</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">currentSpec.runs</span><span class="PUNC">(</span><span class="NAME">func</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>431</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>432</span>
<span class='line'>433</span> </span><span class="COMM">/**
<span class='line'>434</span> * Waits for a timeout before moving to the next runs()-defined block.
<span class='line'>435</span> * @param {Number} timeout
<span class='line'>436</span> */</span><span class="WHIT">
<span class='line'>437</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">waits</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeout</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>438</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">currentSpec.waits</span><span class="PUNC">(</span><span class="NAME">timeout</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>439</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>440</span>
<span class='line'>441</span> </span><span class="COMM">/**
<span class='line'>442</span> * Waits for the latchFunction to return true before proceeding to the next runs()-defined block.
<span class='line'>443</span> *
<span class='line'>444</span> * @param {Number} timeout
<span class='line'>445</span> * @param {Function} latchFunction
<span class='line'>446</span> * @param {String} message
<span class='line'>447</span> */</span><span class="WHIT">
<span class='line'>448</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">waitsFor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeout</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">latchFunction</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>449</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">currentSpec.waitsFor</span><span class="PUNC">(</span><span class="NAME">timeout</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">latchFunction</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>450</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>451</span>
<span class='line'>452</span> </span><span class="COMM">/**
<span class='line'>453</span> * A function that is called before each spec in a suite.
<span class='line'>454</span> *
<span class='line'>455</span> * Used for spec setup, including validating assumptions.
<span class='line'>456</span> *
<span class='line'>457</span> * @param {Function} beforeEachFunction
<span class='line'>458</span> */</span><span class="WHIT">
<span class='line'>459</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">beforeEach</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">beforeEachFunction</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>460</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">beforeEach</span><span class="PUNC">(</span><span class="NAME">beforeEachFunction</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>461</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>462</span>
<span class='line'>463</span> </span><span class="COMM">/**
<span class='line'>464</span> * A function that is called after each spec in a suite.
<span class='line'>465</span> *
<span class='line'>466</span> * Used for restoring any state that is hijacked during spec execution.
<span class='line'>467</span> *
<span class='line'>468</span> * @param {Function} afterEachFunction
<span class='line'>469</span> */</span><span class="WHIT">
<span class='line'>470</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">afterEach</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">afterEachFunction</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>471</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">afterEach</span><span class="PUNC">(</span><span class="NAME">afterEachFunction</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>472</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>473</span>
<span class='line'>474</span> </span><span class="COMM">/**
<span class='line'>475</span> * Defines a suite of specifications.
<span class='line'>476</span> *
<span class='line'>477</span> * Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared
<span class='line'>478</span> * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization
<span class='line'>479</span> * of setup in some tests.
<span class='line'>480</span> *
<span class='line'>481</span> * @example
<span class='line'>482</span> * // TODO: a simple suite
<span class='line'>483</span> *
<span class='line'>484</span> * // TODO: a simple suite with a nested describe block
<span class='line'>485</span> *
<span class='line'>486</span> * @param {String} description A string, usually the class under test.
<span class='line'>487</span> * @param {Function} specDefinitions function that defines several specs.
<span class='line'>488</span> */</span><span class="WHIT">
<span class='line'>489</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">describe</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">description</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">specDefinitions</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>490</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">describe</span><span class="PUNC">(</span><span class="NAME">description</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">specDefinitions</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>491</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>492</span>
<span class='line'>493</span> </span><span class="COMM">/**
<span class='line'>494</span> * Disables a suite of specifications. Used to disable some suites in a file, or files, temporarily during development.
<span class='line'>495</span> *
<span class='line'>496</span> * @param {String} description A string, usually the class under test.
<span class='line'>497</span> * @param {Function} specDefinitions function that defines several specs.
<span class='line'>498</span> */</span><span class="WHIT">
<span class='line'>499</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xdescribe</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">description</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">specDefinitions</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>500</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">xdescribe</span><span class="PUNC">(</span><span class="NAME">description</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">specDefinitions</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>501</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>502</span>
<span class='line'>503</span>
<span class='line'>504</span> </span><span class="COMM">// Provide the XMLHttpRequest class for IE 5.x-6.x:</span><span class="WHIT">
<span class='line'>505</span> </span><span class="NAME">jasmine.XmlHttpRequest</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">XMLHttpRequest</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>506</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>507</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ActiveXObject</span><span class="PUNC">(</span><span class="STRN">"Msxml2.XMLHTTP.6.0"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>508</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>509</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>510</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>511</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ActiveXObject</span><span class="PUNC">(</span><span class="STRN">"Msxml2.XMLHTTP.3.0"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>512</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>513</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>514</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>515</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ActiveXObject</span><span class="PUNC">(</span><span class="STRN">"Msxml2.XMLHTTP"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>516</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>517</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>518</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>519</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ActiveXObject</span><span class="PUNC">(</span><span class="STRN">"Microsoft.XMLHTTP"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>520</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>521</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>522</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"This browser does not support XMLHttpRequest."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>523</span> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">XMLHttpRequest</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>524</span>
<span class='line'>525</span> </span><span class="COMM">/**
<span class='line'>526</span> * Adds suite files to an HTML document so that they are executed, thus adding them to the current
<span class='line'>527</span> * Jasmine environment.
<span class='line'>528</span> *
<span class='line'>529</span> * @param {String} url path to the file to include
<span class='line'>530</span> * @param {Boolean} opt_global
<span class='line'>531</span> */</span><span class="WHIT">
<span class='line'>532</span> </span><span class="NAME">jasmine.include</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">url</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">opt_global</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>533</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">opt_global</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>534</span> </span><span class="WHIT"> </span><span class="NAME">document.write</span><span class="PUNC">(</span><span class="STRN">'&lt;script type="text/javascript" src="'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'">&lt;/'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'script>'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>535</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>536</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xhr</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>537</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>538</span> </span><span class="WHIT"> </span><span class="NAME">xhr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.XmlHttpRequest</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>539</span> </span><span class="WHIT"> </span><span class="NAME">xhr.open</span><span class="PUNC">(</span><span class="STRN">"GET"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">url</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>540</span> </span><span class="WHIT"> </span><span class="NAME">xhr.send</span><span class="PUNC">(</span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>541</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>542</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"couldn't fetch "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">": "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>543</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>544</span>
<span class='line'>545</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">eval</span><span class="PUNC">(</span><span class="NAME">xhr.responseText</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>546</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>547</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>548</span> </span></pre></body></html>

View File

@ -1,185 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">// Mock setTimeout, clearTimeout</span><span class="WHIT">
<span class='line'> 2</span> </span><span class="COMM">// Contributed by Pivotal Computer Systems, www.pivotalsf.com</span><span class="WHIT">
<span class='line'> 3</span>
<span class='line'> 4</span> </span><span class="NAME">jasmine.FakeTimer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 5</span> </span><span class="WHIT"> </span><span class="NAME">this.reset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 6</span>
<span class='line'> 7</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 8</span> </span><span class="WHIT"> </span><span class="NAME">self.setTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 9</span> </span><span class="WHIT"> </span><span class="NAME">self.timeoutsMade</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="NAME">self.scheduleFunction</span><span class="PUNC">(</span><span class="NAME">self.timeoutsMade</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">self.timeoutsMade</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 13</span>
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="NAME">self.setInterval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="NAME">self.timeoutsMade</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="NAME">self.scheduleFunction</span><span class="PUNC">(</span><span class="NAME">self.timeoutsMade</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">self.timeoutsMade</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 19</span>
<span class='line'> 20</span> </span><span class="WHIT"> </span><span class="NAME">self.clearTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="NAME">self.scheduledFunctions</span><span class="PUNC">[</span><span class="NAME">timeoutKey</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.undefined</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 23</span>
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="NAME">self.clearInterval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="NAME">self.scheduledFunctions</span><span class="PUNC">[</span><span class="NAME">timeoutKey</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.undefined</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 27</span>
<span class='line'> 28</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 29</span>
<span class='line'> 30</span> </span><span class="NAME">jasmine.FakeTimer.prototype.reset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="NAME">this.timeoutsMade</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="NAME">this.scheduledFunctions</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="NAME">this.nowMillis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 35</span>
<span class='line'> 36</span> </span><span class="NAME">jasmine.FakeTimer.prototype.tick</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">millis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oldMillis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.nowMillis</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">newMillis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">oldMillis</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="NAME">this.runFunctionsWithinRange</span><span class="PUNC">(</span><span class="NAME">oldMillis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">newMillis</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT"> </span><span class="NAME">this.nowMillis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">newMillis</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 42</span>
<span class='line'> 43</span> </span><span class="NAME">jasmine.FakeTimer.prototype.runFunctionsWithinRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oldMillis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nowMillis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">scheduledFunc</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">funcsToRun</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">timeoutKey</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">this.scheduledFunctions</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="NAME">scheduledFunc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.scheduledFunctions</span><span class="PUNC">[</span><span class="NAME">timeoutKey</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">scheduledFunc</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">jasmine.undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="NAME">scheduledFunc.runAtMillis</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">oldMillis</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="NAME">scheduledFunc.runAtMillis</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NAME">nowMillis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="NAME">funcsToRun.push</span><span class="PUNC">(</span><span class="NAME">scheduledFunc</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="NAME">this.scheduledFunctions</span><span class="PUNC">[</span><span class="NAME">timeoutKey</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.undefined</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 55</span>
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">funcsToRun.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="NAME">funcsToRun.sort</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a.runAtMillis</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">b.runAtMillis</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">funcsToRun.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">++</span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">funcToRun</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">funcsToRun</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="NAME">this.nowMillis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">funcToRun.runAtMillis</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">funcToRun.funcToCall</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">funcToRun.recurring</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="NAME">this.scheduleFunction</span><span class="PUNC">(</span><span class="NAME">funcToRun.timeoutKey</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="NAME">funcToRun.funcToCall</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="NAME">funcToRun.millis</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="NAME">this.runFunctionsWithinRange</span><span class="PUNC">(</span><span class="NAME">oldMillis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nowMillis</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 77</span>
<span class='line'> 78</span> </span><span class="NAME">jasmine.FakeTimer.prototype.scheduleFunction</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">recurring</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="NAME">this.scheduledFunctions</span><span class="PUNC">[</span><span class="NAME">timeoutKey</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="NAME">runAtMillis</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.nowMillis</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="NAME">recurring</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">recurring</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="NAME">timeoutKey</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">timeoutKey</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 87</span>
<span class='line'> 88</span> </span><span class="COMM">/**
<span class='line'> 89</span> * @namespace
<span class='line'> 90</span> */</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="NAME">jasmine.Clock</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="NAME">defaultFakeTimer</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.FakeTimer</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 93</span>
<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="NAME">reset</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.assertInstalled</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.defaultFakeTimer.reset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 98</span>
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="NAME">tick</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">millis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.assertInstalled</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.defaultFakeTimer.tick</span><span class="PUNC">(</span><span class="NAME">millis</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>103</span>
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="NAME">runFunctionsWithinRange</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oldMillis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nowMillis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange</span><span class="PUNC">(</span><span class="NAME">oldMillis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nowMillis</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>107</span>
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="NAME">scheduleFunction</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">recurring</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>109</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.defaultFakeTimer.scheduleFunction</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">recurring</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>111</span>
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="NAME">useMock</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">currentSpec</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="NAME">spec.after</span><span class="PUNC">(</span><span class="NAME">jasmine.Clock.uninstallMock</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>115</span>
<span class='line'>116</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.installMock</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>118</span>
<span class='line'>119</span> </span><span class="WHIT"> </span><span class="NAME">installMock</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.installed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.defaultFakeTimer</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>122</span>
<span class='line'>123</span> </span><span class="WHIT"> </span><span class="NAME">uninstallMock</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>124</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.assertInstalled</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>125</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.installed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.real</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>126</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>127</span>
<span class='line'>128</span> </span><span class="WHIT"> </span><span class="NAME">real</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>129</span> </span><span class="WHIT"> </span><span class="NAME">setTimeout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">window.setTimeout</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>130</span> </span><span class="WHIT"> </span><span class="NAME">clearTimeout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">window.clearTimeout</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>131</span> </span><span class="WHIT"> </span><span class="NAME">setInterval</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">window.setInterval</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>132</span> </span><span class="WHIT"> </span><span class="NAME">clearInterval</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">window.clearInterval</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>134</span>
<span class='line'>135</span> </span><span class="WHIT"> </span><span class="NAME">assertInstalled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.Clock.installed</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.defaultFakeTimer</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"Mock clock is not installed, use jasmine.Clock.useMock()"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>138</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>140</span>
<span class='line'>141</span> </span><span class="WHIT"> </span><span class="NAME">installed</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT">
<span class='line'>142</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>143</span> </span><span class="NAME">jasmine.Clock.installed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.real</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>144</span>
<span class='line'>145</span> </span><span class="COMM">//else for IE support</span><span class="WHIT">
<span class='line'>146</span> </span><span class="NAME">window.setTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>147</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.Clock.installed.setTimeout.apply</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>148</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.installed.setTimeout.apply</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>149</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>150</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.installed.setTimeout</span><span class="PUNC">(</span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>151</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>152</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>153</span>
<span class='line'>154</span> </span><span class="NAME">window.setInterval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>155</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.Clock.installed.setInterval.apply</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>156</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.installed.setInterval.apply</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>157</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>158</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.installed.setInterval</span><span class="PUNC">(</span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>159</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>160</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>161</span>
<span class='line'>162</span> </span><span class="NAME">window.clearTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>163</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.Clock.installed.clearTimeout.apply</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>164</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.installed.clearTimeout.apply</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>165</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>166</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.installed.clearTimeout</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>167</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>168</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>169</span>
<span class='line'>170</span> </span><span class="NAME">window.clearInterval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>171</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.Clock.installed.clearTimeout.apply</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>172</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.installed.clearInterval.apply</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>174</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.installed.clearInterval</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>175</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>176</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>177</span>
<span class='line'>178</span> </span></pre></body></html>

View File

@ -1,75 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
<span class='line'> 2</span> * @namespace
<span class='line'> 3</span> */</span><span class="WHIT">
<span class='line'> 4</span> </span><span class="NAME">jasmine.util</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 5</span>
<span class='line'> 6</span> </span><span class="COMM">/**
<span class='line'> 7</span> * Declare that a child class inherit it's prototype from the parent class.
<span class='line'> 8</span> *
<span class='line'> 9</span> * @private
<span class='line'> 10</span> * @param {Function} childClass
<span class='line'> 11</span> * @param {Function} parentClass
<span class='line'> 12</span> */</span><span class="WHIT">
<span class='line'> 13</span> </span><span class="NAME">jasmine.util.inherit</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">childClass</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">parentClass</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 15</span> * @private
<span class='line'> 16</span> */</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">subclass</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="NAME">subclass.prototype</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parentClass.prototype</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="WHIT"> </span><span class="NAME">childClass.prototype</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">subclass</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 22</span>
<span class='line'> 23</span> </span><span class="NAME">jasmine.util.formatException</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">lineNumber</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.line</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="NAME">lineNumber</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e.line</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.lineNumber</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="NAME">lineNumber</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e.lineNumber</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 31</span>
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">file</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 33</span>
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.sourceURL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="NAME">file</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e.sourceURL</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.fileName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="NAME">file</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e.fileName</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 40</span>
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">message</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.name</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">e.message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">': '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">e.message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">e.toString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 42</span>
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">lineNumber</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="NAME">message</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">' in '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">file</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' (line '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">lineNumber</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">')'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 46</span>
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 49</span>
<span class='line'> 50</span> </span><span class="NAME">jasmine.util.htmlEscape</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">str</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">str</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">str.replace</span><span class="PUNC">(</span><span class="REGX">/&/g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'&amp;'</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="PUNC">.</span><span class="NAME">replace</span><span class="PUNC">(</span><span class="REGX">/&lt;/g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'&lt;'</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="PUNC">.</span><span class="NAME">replace</span><span class="PUNC">(</span><span class="REGX">/>/g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'&gt;'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 56</span>
<span class='line'> 57</span> </span><span class="NAME">jasmine.util.argsToArray</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">args</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">arrayOfArgs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">args.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">arrayOfArgs.push</span><span class="PUNC">(</span><span class="NAME">args</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">arrayOfArgs</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 62</span>
<span class='line'> 63</span> </span><span class="NAME">jasmine.util.extend</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">destination</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">source</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">property</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">source</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">destination</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">source</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">destination</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 67</span>
<span class='line'> 68</span> </span></pre></body></html>

27
example/SpecRunner.html Normal file
View File

@ -0,0 +1,27 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Jasmine Test Runner</title>
<link rel="stylesheet" type="text/css" href="lib/jasmine-##JASMINE_VERSION##/jasmine.css">
<script type="text/javascript" src="lib/jasmine-##JASMINE_VERSION##/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-##JASMINE_VERSION##/jasmine-html.js"></script>
<!-- include source files here... -->
<script type="text/javascript" src="src/Player.js"></script>
<script type="text/javascript" src="src/Song.js"></script>
<!-- include spec files here... -->
<script type="text/javascript" src="spec/SpecHelper.js"></script>
<script type="text/javascript" src="spec/PlayerSpec.js"></script>
</head>
<body>
<div id="REMOVE_THIS_LINE_FROM_BUILD"><p>You must be trying to look at examples in the Jasmine source tree.</p><p>Please download a distribution version of Jasmine at <a href="http://pivotal.github.com/jasmine/">http://pivotal.github.com/jasmine/</a>.</p></div>
<script type="text/javascript">
jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
jasmine.getEnv().execute();
</script>
</body>
</html>

View File

@ -0,0 +1,58 @@
describe("Player", function() {
var player;
var song;
beforeEach(function() {
player = new Player();
song = new Song();
});
it("should be able to play a Song", function() {
player.play(song);
expect(player.currentlyPlayingSong).toEqual(song);
//demonstrates use of custom matcher
expect(player).toBePlaying(song);
});
describe("when song has been paused", function() {
beforeEach(function() {
player.play(song);
player.pause();
});
it("should indicate that the song is currently paused", function() {
expect(player.isPlaying).toBeFalsy();
// demonstrates use of 'not' with a custom matcher
expect(player).not.toBePlaying(song);
});
it("should be possible to resume", function() {
player.resume();
expect(player.isPlaying).toBeTruthy();
expect(player.currentlyPlayingSong).toEqual(song);
});
});
// demonstrates use of spies to intercept and test method calls
it("tells the current song if the user has made it a favorite", function() {
spyOn(song, 'persistFavoriteStatus');
player.play(song);
player.makeFavorite();
expect(song.persistFavoriteStatus).toHaveBeenCalledWith(true);
});
//demonstrates use of expected exceptions
describe("#resume", function() {
it("should throw an exception if song is already playing", function() {
player.play(song);
expect(function() {
player.resume();
}).toThrow("song is already playing");
});
});
});

View File

@ -0,0 +1,9 @@
beforeEach(function() {
this.addMatchers({
toBePlaying: function(expectedSong) {
var player = this.actual;
return player.currentlyPlayingSong === expectedSong &&
player.isPlaying;
}
});
});

22
example/src/Player.js Normal file
View File

@ -0,0 +1,22 @@
function Player() {
}
Player.prototype.play = function(song) {
this.currentlyPlayingSong = song;
this.isPlaying = true;
};
Player.prototype.pause = function() {
this.isPlaying = false;
};
Player.prototype.resume = function() {
if (this.isPlaying) {
throw new Error("song is already playing");
}
this.isPlaying = true;
};
Player.prototype.makeFavorite = function() {
this.currentlyPlayingSong.persistFavoriteStatus(true);
};

7
example/src/Song.js Normal file
View File

@ -0,0 +1,7 @@
function Song() {
}
Song.prototype.persistFavoriteStatus = function(value) {
// something complicated
throw new Error("not yet implemented");
};

View File

@ -1,27 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Jasmine Test Runner</title>
</head>
<script type="text/javascript" src="../../lib/jasmine-0.10.1.js"></script>
<script type="text/javascript" src="../../lib/TrivialReporter.js"></script>
<script type="text/javascript" src="../../lib/consolex.js"></script>
<link rel="stylesheet" type="text/css" href="../../lib/jasmine.css">
<script type="text/javascript">
jasmine.include('spec/example_suite.js', true);
</script>
<body>
<script type="text/javascript">
var jasmineEnv = jasmine.getEnv();
jasmineEnv.reporter = new jasmine.TrivialReporter();
jasmineEnv.execute();
</script>
</body>
</html>

View File

@ -1,11 +0,0 @@
describe('ExampleSuite', function () {
it('should have a passing test', function() {
expect(true).toEqual(true);
});
describe('Nested Describe', function () {
it('should also have a passing test', function () {
expect(true).toEqual(true);
});
});
});

View File

@ -1,33 +0,0 @@
require File.expand_path(File.join(File.dirname(__FILE__), "spec/jasmine_helper.rb"))
namespace :test do
desc "Run continuous integration tests"
task :ci => :'ci:local'
namespace :ci do
require "spec"
require 'spec/rake/spectask'
Spec::Rake::SpecTask.new(:local) do |t|
t.spec_opts = ["--color", "--format", "specdoc"]
t.spec_files = ["spec/jasmine_spec.rb"]
end
desc "Run continuous integration tests using Sauce Labs 'Selenium in the Cloud'"
task :saucelabs do
ENV['SAUCELABS'] = 'true'
Rake::Task['test:ci:local'].invoke
end
end
end
desc "Run specs via server"
task :jasmine_server do
require File.expand_path(File.join(JasmineHelper.jasmine_root, "contrib/ruby/jasmine_spec_builder"))
puts "your tests are here:"
puts " http://localhost:8888/run.html"
Jasmine::SimpleServer.start(8888,
lambda { JasmineHelper.specs },
JasmineHelper.dir_mappings)
end

View File

@ -1,11 +0,0 @@
describe('ExampleSuite', function () {
it('should have a passing test', function() {
expect(true).toEqual(true);
});
describe('Nested Describe', function () {
it('should also have a passing test', function () {
expect(true).toEqual(true);
});
});
});

View File

@ -1,41 +0,0 @@
class JasmineHelper
def self.jasmine_lib_dir
File.expand_path(File.join(jasmine_root, 'lib'))
end
def self.jasmine_root
File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..'))
end
def self.jasmine
['/lib/' + File.basename(Dir.glob("#{JasmineHelper.jasmine_lib_dir}/jasmine*.js").first)] +
['/lib/json2.js',
'/lib/TrivialReporter.js',
'/lib/consolex.js'
]
end
def self.jasmine_src_dir
File.expand_path(File.join(jasmine_root, 'src'))
end
def self.jasmine_spec_dir
File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec'))
end
def self.raw_spec_files
Dir.glob(File.join(jasmine_spec_dir, "**/*[Ss]pec.js"))
end
def self.specs
raw_spec_files.collect {|f| f.sub(jasmine_spec_dir, "/spec")}
end
def self.dir_mappings
{
"/src" => jasmine_src_dir,
"/spec" => jasmine_spec_dir,
"/lib" => jasmine_lib_dir
}
end
end

View File

@ -1,31 +0,0 @@
require 'rubygems'
require File.expand_path(File.join(File.dirname(__FILE__), "jasmine_helper.rb"))
require File.expand_path(File.join(JasmineHelper.jasmine_root, "contrib/ruby/jasmine_spec_builder"))
jasmine_runner = if ENV['SAUCELABS'] == 'true'
require 'sauce_tunnel'
require 'selenium_config'
Jasmine::SauceLabsRunner.new(JasmineHelper.specs,
JasmineHelper.dir_mappings,
:saucelabs_config => 'saucelabs',
:saucelabs_config_file => File.expand_path(File.join(File.dirname(__FILE__), "saucelabs.yml")))
else
require "selenium_rc"
Jasmine::Runner.new(SeleniumRC::Server.new('localhost').jar_path,
JasmineHelper.specs,
JasmineHelper.dir_mappings)
end
spec_builder = Jasmine::SpecBuilder.new(JasmineHelper.raw_spec_files, jasmine_runner)
should_stop = false
Spec::Runner.configure do |config|
config.after(:suite) do
spec_builder.stop if should_stop
end
end
spec_builder.start
should_stop = true
spec_builder.declare_suites

View File

@ -1,24 +0,0 @@
local:
application_framework: :selenium
#
# Possible Sauce Labs configurations as of 2009/11/19
# From: http://saucelabs.com/products/docs/sauce-ondemand/browsers
# os: "Windows 2003"
# browser: "iexplore"
# browser-version: "6.", "7.", "8."
# browser: "firefox"
# browser-version: "2.", "3.0", "3.5"
# browser: "safari"
# browser-version: "3.", "4."
# browser: "opera"
# browser-version: "9."
# browser: "googlechrome"
# browser-version: ""
# os: "Linux"
# browser: "firefox"
# browser-version: "3."
saucelabs:
application_framework: :external
selenium_server_address: "saucelabs.com"
selenium_browser_key: '{"username": "--YOUR-SAUCELABS-USERNAME--", "access-key": "--YOUR-SAUCELABS-ACCESS-KEY--", "os": "Linux", "browser": "firefox", "browser-version": "3."}'
application_port: "80"

View File

@ -1,25 +0,0 @@
---
gems:
- name: rake
version: 0.8.7
- name: ragaskar-jsdoc_helper
version: 0.0.2.1
- name: json
version: 1.1.9
- name: selenium-rc
version: 2.2.0
- name: rack
version: 1.0.0
- name: thin
version: 1.2.4
- name: eventmachine
version: 0.12.8
- name: rspec
version: 1.2.9
- name: selenium-client
version: 1.2.18
- name: rest-client
version: 1.0.3
- name: saucelabs-adapter
version: 0.3.2
install_options: --source=http://gems.pivotallabs.com

Binary file not shown.

Before

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

BIN
images/jasmine_favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 802 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 768 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,17 @@
<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 />

View File

@ -0,0 +1,56 @@
<!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
jsdoc-template/class.tmpl Normal file
View File

@ -0,0 +1,646 @@
<!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
jsdoc-template/index.tmpl Normal file
View File

@ -0,0 +1,39 @@
<!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>
<div id="content">
<h1 class="classTitle">Class Index</h1>
<for each="thisClass" in="data">
<div>
<h2>{+(new Link().toSymbol(thisClass.alias))+}</h2>
{+resolveLinks(summarize(thisClass.classDesc))+}
</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>

184
jsdoc-template/publish.js Normal file
View File

@ -0,0 +1,184 @@
/** Called automatically by JsDoc Toolkit. */
function publish(symbolSet) {
publish.conf = { // trailing slash expected for dirs
ext: ".html",
outDir: JSDOC.opt.d || SYS.pwd+"../out/jsdoc/",
templatesDir: JSDOC.opt.t || SYS.pwd+"../templates/jsdoc/",
symbolsDir: "symbols/",
srcDir: "symbols/src/"
};
// is source output is suppressed, just display the links to the source file
if (JSDOC.opt.s && defined(Link) && Link.prototype._makeSrcLink) {
Link.prototype._makeSrcLink = function(srcFilePath) {
return "&lt;"+srcFilePath+"&gt;";
}
}
// create the folders and subfolders to hold the output
IO.mkPath((publish.conf.outDir+"symbols/src").split("/"));
// used to allow Link to check the details of things being linked to
Link.symbolSet = symbolSet;
// create the required templates
try {
var classTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"class.tmpl");
var classesTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"allclasses.tmpl");
}
catch(e) {
print("Couldn't create the required templates: "+e);
quit();
}
// some ustility filters
function hasNoParent($) {return ($.memberOf == "")}
function isaFile($) {return ($.is("FILE"))}
function isaClass($) {return ($.is("CONSTRUCTOR") || $.isNamespace)}
// get an array version of the symbolset, useful for filtering
var symbols = symbolSet.toArray();
// create the hilited source code files
var files = JSDOC.opt.srcFiles;
for (var i = 0, l = files.length; i < l; i++) {
var file = files[i];
var srcDir = publish.conf.outDir + "symbols/src/";
makeSrcFile(file, srcDir);
}
// get a list of all the classes in the symbolset
var classes = symbols.filter(isaClass).sort(makeSortby("alias"));
// create a class index, displayed in the left-hand column of every class page
Link.base = "../";
publish.classesIndex = classesTemplate.process(classes); // kept in memory
// create each of the class pages
for (var i = 0, l = classes.length; i < l; i++) {
var symbol = classes[i];
symbol.events = symbol.getEvents(); // 1 order matters
symbol.methods = symbol.getMethods(); // 2
var output = "";
output = classTemplate.process(symbol);
IO.saveFile(publish.conf.outDir+"symbols/", symbol.alias+publish.conf.ext, output);
}
// regenerate the index with different relative links, used in the index pages
Link.base = "";
publish.classesIndex = classesTemplate.process(classes);
// create the class index page
try {
var classesindexTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"index.tmpl");
}
catch(e) { print(e.message); quit(); }
var classesIndex = classesindexTemplate.process(classes);
IO.saveFile(publish.conf.outDir, "index"+publish.conf.ext, classesIndex);
classesindexTemplate = classesIndex = classes = null;
// create the file index page
try {
var fileindexTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"allfiles.tmpl");
}
catch(e) { print(e.message); quit(); }
var documentedFiles = symbols.filter(isaFile); // files that have file-level docs
var allFiles = []; // not all files have file-level docs, but we need to list every one
for (var i = 0; i < files.length; i++) {
allFiles.push(new JSDOC.Symbol(files[i], [], "FILE", new JSDOC.DocComment("/** */")));
}
for (var i = 0; i < documentedFiles.length; i++) {
var offset = files.indexOf(documentedFiles[i].alias);
allFiles[offset] = documentedFiles[i];
}
allFiles = allFiles.sort(makeSortby("name"));
// output the file index page
var filesIndex = fileindexTemplate.process(allFiles);
IO.saveFile(publish.conf.outDir, "files"+publish.conf.ext, filesIndex);
fileindexTemplate = filesIndex = files = null;
}
/** Just the first sentence (up to a full stop). Should not break on dotted variable names. */
function summarize(desc) {
if (typeof desc != "undefined")
return desc.match(/([\w\W]+?\.)[^a-z0-9_$]/i)? RegExp.$1 : desc;
}
/** Make a symbol sorter by some attribute. */
function makeSortby(attribute) {
return function(a, b) {
if (a[attribute] != undefined && b[attribute] != undefined) {
a = a[attribute].toLowerCase();
b = b[attribute].toLowerCase();
if (a < b) return -1;
if (a > b) return 1;
return 0;
}
}
}
/** Pull in the contents of an external file at the given path. */
function include(path) {
var path = publish.conf.templatesDir+path;
return IO.readFile(path);
}
/** Turn a raw source file into a code-hilited page in the docs. */
function makeSrcFile(path, srcDir, name) {
if (JSDOC.opt.s) return;
if (!name) {
name = path.replace(/\.\.?[\\\/]/g, "").replace(/[\\\/]/g, "_");
name = name.replace(/\:/g, "_");
}
var src = {path: path, name:name, charset: IO.encoding, hilited: ""};
if (defined(JSDOC.PluginManager)) {
JSDOC.PluginManager.run("onPublishSrc", src);
}
if (src.hilited) {
IO.saveFile(srcDir, name+publish.conf.ext, src.hilited);
}
}
/** Build output for displaying function parameters. */
function makeSignature(params) {
if (!params) return "()";
var signature = "("
+
params.filter(
function($) {
return $.name.indexOf(".") == -1; // don't show config params in signature
}
).map(
function($) {
return $.name;
}
).join(", ")
+
")";
return signature;
}
/** Find symbol {@link ...} strings in text and turn into html links */
function resolveLinks(str, from) {
str = str.replace(/\{@link ([^} ]+) ?\}/gi,
function(match, symbolName) {
return new Link().toSymbol(symbolName);
}
);
return str;
}

View File

@ -0,0 +1,162 @@
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}

View File

@ -0,0 +1,2 @@
<div id="header">
</div>

View File

@ -0,0 +1,19 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Generated Javascript Documentation</title>
</head>
<frameset cols="20%,80%">
<frame src="allclasses-frame.html" name="packageFrame" />
<frame src="splash.html" name="classFrame" />
<noframes>
<body>
<p>
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
</p>
</body>
</noframes>
</frameset>
</html>

View File

@ -0,0 +1,35 @@
<symbol alias="{+data.alias+}">
<name>{+data.name+}</name>
<memberOf>{+data.memberOf+}</memberOf>
<isStatic>{+data.isStatic+}</isStatic>
<isa>{+data.isa+}</isa>
<desc>{+data.desc+}</desc>
<classDesc>{+data.classDesc+}</classDesc>
<methods><for each="method" in="data.methods">
<method>
<name>{+method.name+}</name>
<memberOf>{+method.memberOf+}</memberOf>
<isStatic>{+method.isStatic+}</isStatic>
<desc>{+method.desc+}</desc>
<params><for each="param" in="method.params">
<param>
<type>{+param.type+}</type>
<name>{+param.name+}</name>
<desc>{+param.desc+}</desc>
<defaultValue>{+param.defaultValue+}</defaultValue>
</param></for>
</params>
</method></for>
</methods>
<properties><for each="property" in="data.properties">
<property>
<name>{+property.name+}</name>
<memberOf>{+property.memberOf+}</memberOf>
<isStatic>{+property.isStatic+}</isStatic>
<desc>{+property.desc+}</desc>
<type>{+property.type+}</type>
</property></for>
</properties>
</symbol>

5919
jshint/jshint.js Executable file

File diff suppressed because it is too large Load Diff

99
jshint/run.js Normal file
View File

@ -0,0 +1,99 @@
var fs = require("fs");
var sys = require("sys");
var path = require("path");
var JSHINT = require("./jshint").JSHINT;
// DWF TODO: Standardize this?
function isExcluded(fullPath) {
var fileName = path.basename(fullPath);
var excludeFiles = ["json2.js", "jshint.js", "publish.js", "node_suite.js", "jasmine.js", "jasmine-html.js"];
for (var i = 0; i < excludeFiles.length; i++) {
if (fileName == excludeFiles[i]) {
return true;
}
}
return false;
}
// DWF TODO: This function could/should be re-written
function allJasmineJsFiles(rootDir) {
var files = [];
fs.readdirSync(rootDir).filter(function(filename) {
var fullPath = rootDir + "/" + filename;
if (fs.statSync(fullPath).isDirectory() && !fullPath.match(/pages/)) {
var subDirFiles = allJasmineJsFiles(fullPath);
if (subDirFiles.length > 0) {
files = files.concat();
return true;
}
} else {
if (fullPath.match(/\.js$/) && !isExcluded(fullPath)) {
files.push(fullPath);
return true;
}
}
return false;
});
return files;
}
var jasmineJsFiles = allJasmineJsFiles(".");
jasmineJsFiles.reverse(); //cheap way to do the stuff in src stuff first
var jasmineJsHintConfig = {
forin:true, //while it's possible that we could be
//considering unwanted prototype methods, mostly
//we're doing this because the jsobjects are being
//used as maps.
loopfunc:true //we're fine with functions defined inside loops (setTimeout functions, etc)
};
var jasmineGlobals = {};
//jasmine.undefined is a jasmine-ism, let's let it go...
function removeJasmineUndefinedErrors(errors) {
var keepErrors = [];
for (var i = 0; i < errors.length; i++) {
if (!(errors[i] &&
errors[i].raw &&
errors[i].evidence &&
( errors[i].evidence.match(/jasmine\.undefined/) ||
errors[i].evidence.match(/diz be undefined yo/) )
)) {
keepErrors.push(errors[i]);
}
}
return keepErrors;
}
(function() {
var ansi = {
green: '\033[32m',
red: '\033[31m',
yellow: '\033[33m',
none: '\033[0m'
};
for (var i = 0; i < jasmineJsFiles.length; i++) {
var file = jasmineJsFiles[i];
JSHINT(fs.readFileSync(file, "utf8"), jasmineJsHintConfig);
var errors = JSHINT.data().errors || [];
errors = removeJasmineUndefinedErrors(errors);
if (errors.length >= 1) {
console.log(ansi.red + "Jasmine JSHint failure: " + ansi.none);
console.log(file);
console.log(errors);
process.exit(1);
}
}
console.log(ansi.green + "Jasmine JSHint PASSED." + ansi.none);
})();

View File

@ -1,117 +0,0 @@
jasmine.TrivialReporter = function(doc) {
this.document = doc || document;
this.suiteDivs = {};
};
jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
var el = document.createElement(type);
for (var i = 2; i < arguments.length; i++) {
var child = arguments[i];
if (typeof child === 'string') {
el.appendChild(document.createTextNode(child));
} else {
if (child) { el.appendChild(child); }
}
}
for (var attr in attrs) {
el[attr] = attrs[attr];
}
return el;
};
jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
var suites = runner.suites();
this.runnerDiv = this.createDom('div', { className: 'runner running' },
this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
this.runnerMessageSpan = this.createDom('span', {}, "Running..."));
this.document.body.appendChild(this.runnerDiv);
for (var i = 0; i < suites.length; i++) {
var suite = suites[i];
var suiteDiv = this.createDom('div', { className: 'suite' },
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
this.suiteDivs[suite.getFullName()] = suiteDiv;
var parentDiv = this.document.body;
if (suite.parentSuite) {
parentDiv = this.suiteDivs[suite.parentSuite.getFullName()];
}
parentDiv.appendChild(suiteDiv);
}
this.startedAt = new Date();
};
jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
var results = runner.results();
var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
this.runnerDiv.setAttribute("class", className);
//do it twice for IE
this.runnerDiv.setAttribute("className", className);
var specs = runner.specs();
var specCount = 0;
for (var i = 0; i < specs.length; i++) {
if (this.specFilter(specs[i])) {
specCount++;
}
}
var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
};
jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
var results = suite.results();
var status = results.passed() ? 'passed' : 'failed';
if (results.totalCount == 0) { // todo: change this to check results.skipped
status = 'skipped';
}
this.suiteDivs[suite.getFullName()].className += " " + status;
};
jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
var results = spec.results();
var status = results.passed() ? 'passed' : 'failed';
if (results.skipped) {
status = 'skipped';
}
var specDiv = this.createDom('div', { className: 'spec ' + status },
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, spec.getFullName()));
var resultItems = results.getItems();
for (var i = 0; i < resultItems.length; i++) {
var result = resultItems[i];
if (result.passed && !result.passed()) {
specDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
specDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
}
}
this.suiteDivs[spec.suite.getFullName()].appendChild(specDiv);
};
jasmine.TrivialReporter.prototype.log = function() {
console.log.apply(console, arguments);
};
jasmine.TrivialReporter.prototype.getLocation = function() {
return this.document.location;
};
jasmine.TrivialReporter.prototype.specFilter = function(spec) {
var paramMap = {};
var params = this.getLocation().search.substring(1).split('&');
for (var i = 0; i < params.length; i++) {
var p = params[i].split('=');
paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
}
if (!paramMap["spec"]) return true;
return spec.getFullName().indexOf(paramMap["spec"]) == 0;
};

View File

@ -1,28 +0,0 @@
/** Console X
* http://github.com/deadlyicon/consolex.js
*
* By Jared Grippe <jared@jaredgrippe.com>
*
* Copyright (c) 2009 Jared Grippe
* Licensed under the MIT license.
*
* consolex avoids ever having to see javascript bugs in browsers that do not implement the entire
* firebug console suit
*
*/
(function(window) {
window.console || (window.console = {});
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
function emptyFunction(){}
for (var i = 0; i < names.length; ++i){
window.console[names[i]] || (window.console[names[i]] = emptyFunction);
if (typeof window.console[names[i]] !== 'function')
window.console[names[i]] = (function(method) {
return function(){ return Function.prototype.apply.apply(method, [console,arguments]); };
})(window.console[names[i]]);
}
})(this);

190
lib/jasmine-html.js Normal file
View File

@ -0,0 +1,190 @@
jasmine.TrivialReporter = function(doc) {
this.document = doc || document;
this.suiteDivs = {};
this.logRunningSpecs = false;
};
jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
var el = document.createElement(type);
for (var i = 2; i < arguments.length; i++) {
var child = arguments[i];
if (typeof child === 'string') {
el.appendChild(document.createTextNode(child));
} else {
if (child) { el.appendChild(child); }
}
}
for (var attr in attrs) {
if (attr == "className") {
el[attr] = attrs[attr];
} else {
el.setAttribute(attr, attrs[attr]);
}
}
return el;
};
jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
var showPassed, showSkipped;
this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' },
this.createDom('div', { className: 'banner' },
this.createDom('div', { className: 'logo' },
this.createDom('a', { href: 'http://pivotal.github.com/jasmine/', target: "_blank" }, "Jasmine"),
this.createDom('span', { className: 'version' }, runner.env.versionString())),
this.createDom('div', { className: 'options' },
"Show ",
showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
)
),
this.runnerDiv = this.createDom('div', { className: 'runner running' },
this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
);
this.document.body.appendChild(this.outerDiv);
var suites = runner.suites();
for (var i = 0; i < suites.length; i++) {
var suite = suites[i];
var suiteDiv = this.createDom('div', { className: 'suite' },
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
this.suiteDivs[suite.id] = suiteDiv;
var parentDiv = this.outerDiv;
if (suite.parentSuite) {
parentDiv = this.suiteDivs[suite.parentSuite.id];
}
parentDiv.appendChild(suiteDiv);
}
this.startedAt = new Date();
var self = this;
showPassed.onclick = function(evt) {
if (showPassed.checked) {
self.outerDiv.className += ' show-passed';
} else {
self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
}
};
showSkipped.onclick = function(evt) {
if (showSkipped.checked) {
self.outerDiv.className += ' show-skipped';
} else {
self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
}
};
};
jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
var results = runner.results();
var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
this.runnerDiv.setAttribute("class", className);
//do it twice for IE
this.runnerDiv.setAttribute("className", className);
var specs = runner.specs();
var specCount = 0;
for (var i = 0; i < specs.length; i++) {
if (this.specFilter(specs[i])) {
specCount++;
}
}
var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
};
jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
var results = suite.results();
var status = results.passed() ? 'passed' : 'failed';
if (results.totalCount === 0) { // todo: change this to check results.skipped
status = 'skipped';
}
this.suiteDivs[suite.id].className += " " + status;
};
jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
if (this.logRunningSpecs) {
this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
}
};
jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
var results = spec.results();
var status = results.passed() ? 'passed' : 'failed';
if (results.skipped) {
status = 'skipped';
}
var specDiv = this.createDom('div', { className: 'spec ' + status },
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
this.createDom('a', {
className: 'description',
href: '?spec=' + encodeURIComponent(spec.getFullName()),
title: spec.getFullName()
}, spec.description));
var resultItems = results.getItems();
var messagesDiv = this.createDom('div', { className: 'messages' });
for (var i = 0; i < resultItems.length; i++) {
var result = resultItems[i];
if (result.type == 'log') {
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
} else if (result.type == 'expect' && result.passed && !result.passed()) {
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
if (result.trace.stack) {
messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
}
}
}
if (messagesDiv.childNodes.length > 0) {
specDiv.appendChild(messagesDiv);
}
this.suiteDivs[spec.suite.id].appendChild(specDiv);
};
jasmine.TrivialReporter.prototype.log = function() {
var console = jasmine.getGlobal().console;
if (console && console.log) {
if (console.log.apply) {
console.log.apply(console, arguments);
} else {
console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
}
}
};
jasmine.TrivialReporter.prototype.getLocation = function() {
return this.document.location;
};
jasmine.TrivialReporter.prototype.specFilter = function(spec) {
var paramMap = {};
var params = this.getLocation().search.substring(1).split('&');
for (var i = 0; i < params.length; i++) {
var p = params[i].split('=');
paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
}
if (!paramMap.spec) {
return true;
}
return spec.getFullName().indexOf(paramMap.spec) === 0;
};

View File

@ -3,8 +3,40 @@ body {
} }
body .run_spec { .jasmine_reporter a:visited, .jasmine_reporter a {
color: #303;
}
.jasmine_reporter a:hover, .jasmine_reporter a:active {
color: blue;
}
.run_spec {
float:right; float:right;
padding-right: 5px;
font-size: .8em;
text-decoration: none;
}
.jasmine_reporter {
margin: 0 5px;
}
.banner {
color: #303;
background-color: #fef;
padding: 5px;
}
.logo {
float: left;
font-size: 1.1em;
padding-left: 5px;
}
.logo .version {
font-size: .6em;
padding-left: 1em;
} }
.runner.running { .runner.running {
@ -12,24 +44,26 @@ body .run_spec {
} }
.options {
.runner { text-align: right;
border: 1px solid gray; font-size: .8em;
margin: 5px;
padding-left: 1em;
padding-right: 1em;
} }
.suite { .suite {
border: 1px outset gray; border: 1px outset gray;
margin: 5px; margin: 5px 0;
padding-left: 1em; padding-left: 1em;
} }
.suite .suite {
margin: 5px;
}
.suite.passed { .suite.passed {
background-color: #cfc; background-color: #dfd;
} }
.suite.failed { .suite.failed {
@ -38,22 +72,51 @@ body .run_spec {
.spec { .spec {
margin: 5px; margin: 5px;
padding-left: 1em;
clear: both; clear: both;
} }
.spec.failed, .spec.passed, .spec.skipped {
padding-bottom: 5px;
border: 1px solid gray;
}
.spec.failed {
background-color: #fbb;
border-color: red;
}
.spec.passed {
background-color: #bfb;
border-color: green;
}
.spec.skipped {
background-color: #bbb;
}
.messages {
border-left: 1px dashed gray;
padding-left: 1em;
padding-right: 1em;
}
.passed { .passed {
background-color: #cfc; background-color: #cfc;
display: none;
} }
.failed { .failed {
background-color: #fdd; background-color: #fbb;
} }
.skipped { .skipped {
color: #777; color: #777;
background-color: #eee; background-color: #eee;
display: none;
} }
/*.resultMessage {*/ /*.resultMessage {*/
/*white-space: pre;*/ /*white-space: pre;*/
/*}*/ /*}*/
@ -72,15 +135,32 @@ body .run_spec {
white-space: pre; white-space: pre;
font-size: .8em; font-size: .8em;
margin-left: 10px; margin-left: 10px;
height: 5em; max-height: 5em;
overflow: auto; overflow: auto;
border: 1px inset red; border: 1px inset red;
padding: 1em; padding: 1em;
background: #eef; background: #eef;
} }
.finished-at {
padding-left: 1em;
font-size: .6em;
}
.show-passed .passed,
.show-skipped .skipped {
display: block;
}
#jasmine_content { #jasmine_content {
position:fixed; position:fixed;
right: 100%; right: 100%;
} }
.runner {
border: 1px solid gray;
display: block;
margin: 5px 0;
padding: 2px 0 2px 10px;
}

File diff suppressed because it is too large Load Diff

1
pages Submodule

@ -0,0 +1 @@
Subproject commit d08ce2de245d6782c09c652045a12e93af0dc7ec

View File

@ -1,44 +0,0 @@
class JasmineHelper
def self.jasmine_lib_dir
File.expand_path(File.join(jasmine_root, 'lib'))
end
def self.jasmine
['/lib/' + File.basename(Dir.glob("#{JasmineHelper.jasmine_lib_dir}/jasmine*.js").first)] +
['/lib/json2.js',
'/lib/TrivialReporter.js']
end
def self.jasmine_root
File.expand_path(File.join(File.dirname(__FILE__), '..'))
end
def self.jasmine_src_dir
File.expand_path(File.join(jasmine_root, 'src'))
end
def self.jasmine_lib_dir
File.expand_path(File.join(jasmine_root, 'lib'))
end
def self.jasmine_spec_dir
File.expand_path(File.join(jasmine_root, 'spec'))
end
def self.raw_spec_files
Dir.glob(File.join(jasmine_spec_dir, "**/*[Ss]pec.js"))
end
def self.specs
Jasmine.cachebust(raw_spec_files).collect {|f| f.sub(jasmine_spec_dir, "/spec")}
end
def self.dir_mappings
{
"/src" => jasmine_src_dir,
"/spec" => jasmine_spec_dir,
"/lib" => jasmine_lib_dir
}
end
end

View File

@ -1,31 +0,0 @@
require 'rubygems'
require File.expand_path(File.join(File.dirname(__FILE__), "jasmine_helper.rb"))
require File.expand_path(File.join(JasmineHelper.jasmine_root, "contrib/ruby/jasmine_spec_builder"))
jasmine_runner = if ENV['SAUCELABS'] == 'true'
require 'sauce_tunnel'
require 'selenium_config'
Jasmine::SauceLabsRunner.new(JasmineHelper.specs,
JasmineHelper.dir_mappings,
:saucelabs_config => 'saucelabs',
:saucelabs_config_file => File.expand_path(File.join(File.dirname(__FILE__), "saucelabs.yml")))
else
require "selenium_rc"
Jasmine::Runner.new(SeleniumRC::Server.new('localhost').jar_path,
JasmineHelper.specs,
JasmineHelper.dir_mappings)
end
spec_builder = Jasmine::SpecBuilder.new(JasmineHelper.raw_spec_files, jasmine_runner)
should_stop = false
Spec::Runner.configure do |config|
config.after(:suite) do
spec_builder.stop if should_stop
end
end
spec_builder.start
should_stop = true
spec_builder.declare_suites

127
spec/node_suite.js Normal file
View File

@ -0,0 +1,127 @@
var fs = require('fs');
var sys = require('sys');
var path = require('path');
// yes, really keep this here to keep us honest, but only for jasmine's own runner! [xw]
// undefined = "diz be undefined yo";
var jasmineGlobals = require('../lib/jasmine.js');
for (var k in jasmineGlobals) {
global[k] = jasmineGlobals[k];
}
require('../src/console/TrivialConsoleReporter.js');
/*
Pulling in code from jasmine-node.
We can't just depend on jasmine-node because it has its own jasmine that it uses.
*/
global.window = {
setTimeout: setTimeout,
clearTimeout: clearTimeout,
setInterval: setInterval,
clearInterval: clearInterval
};
delete global.window;
function noop() {
}
jasmine.executeSpecs = function(specs, done) {
for (var i = 0, len = specs.length; i < len; ++i) {
var filename = specs[i];
require(filename.replace(/\.\w+$/, ""));
}
var jasmineEnv = jasmine.getEnv();
var consoleReporter = new jasmine.TrivialConsoleReporter(sys.print, done);
jasmineEnv.addReporter(consoleReporter);
jasmineEnv.execute();
};
jasmine.getAllSpecFiles = function(dir, matcher) {
var specs = [];
if (fs.statSync(dir).isFile() && dir.match(matcher)) {
specs.push(dir);
} else {
var files = fs.readdirSync(dir);
for (var i = 0, len = files.length; i < len; ++i) {
var filename = dir + '/' + files[i];
if (fs.statSync(filename).isFile() && filename.match(matcher)) {
specs.push(filename);
} else if (fs.statSync(filename).isDirectory()) {
var subfiles = this.getAllSpecFiles(filename, matcher);
subfiles.forEach(function(result) {
specs.push(result);
});
}
}
}
return specs;
};
function now() {
return new Date().getTime();
}
jasmine.asyncSpecWait = function() {
var wait = jasmine.asyncSpecWait;
wait.start = now();
wait.done = false;
(function innerWait() {
waits(10);
runs(function() {
if (wait.start + wait.timeout < now()) {
expect('timeout waiting for spec').toBeNull();
} else if (wait.done) {
wait.done = false;
} else {
innerWait();
}
});
})();
};
jasmine.asyncSpecWait.timeout = 4 * 1000;
jasmine.asyncSpecDone = function() {
jasmine.asyncSpecWait.done = true;
};
for (var key in jasmine) {
exports[key] = jasmine[key];
}
/*
End jasmine-node runner
*/
var isVerbose = false;
var showColors = true;
process.argv.forEach(function(arg) {
switch (arg) {
case '--color': showColors = true; break;
case '--noColor': showColors = false; break;
case '--verbose': isVerbose = true; break;
}
});
var specs = jasmine.getAllSpecFiles(__dirname + '/suites', new RegExp(".js$"));
var domIndependentSpecs = [];
for (var i = 0; i < specs.length; i++) {
if (fs.readFileSync(specs[i], "utf8").indexOf("document.createElement") < 0) {
domIndependentSpecs.push(specs[i]);
}
}
jasmine.executeSpecs(domIndependentSpecs, function(runner, log) {
if (runner.results().failedCount === 0) {
process.exit(0);
} else {
process.exit(1);
}
}, isVerbose, showColors);

View File

@ -8,55 +8,38 @@
// yes, really keep this here to keep us honest, but only for jasmine's own runner! [xw] // yes, really keep this here to keep us honest, but only for jasmine's own runner! [xw]
undefined = "diz be undefined yo"; undefined = "diz be undefined yo";
</script> </script>
<link rel="shortcut icon" type="image/png" href="../images/jasmine_favicon.png">
<script type="text/javascript" src="../lib/jasmine.js"></script>
<script type="text/javascript" src="../src/base.js"></script> <script type="text/javascript" src="../src/html/TrivialReporter.js"></script>
<script type="text/javascript" src="../src/util.js"></script> <script type="text/javascript" src="../src/console/TrivialConsoleReporter.js"></script>
<script type="text/javascript" src="../src/Env.js"></script>
<script type="text/javascript" src="../src/Reporter.js"></script>
<script type="text/javascript" src="../src/Block.js"></script>
<script type="text/javascript" src="../src/JsApiReporter.js"></script>
<script type="text/javascript" src="../src/Matchers.js"></script>
<script type="text/javascript" src="../src/mock-timeout.js"></script>
<script type="text/javascript" src="../src/MultiReporter.js"></script>
<script type="text/javascript" src="../src/NestedResults.js"></script>
<script type="text/javascript" src="../src/PrettyPrinter.js"></script>
<script type="text/javascript" src="../src/Queue.js"></script>
<script type="text/javascript" src="../src/Reporters.js"></script>
<script type="text/javascript" src="../src/Runner.js"></script>
<script type="text/javascript" src="../src/Spec.js"></script>
<script type="text/javascript" src="../src/Suite.js"></script>
<script type="text/javascript" src="../src/WaitsBlock.js"></script>
<script type="text/javascript" src="../src/WaitsForBlock.js"></script>
<script type="text/javascript" src="../lib/TrivialReporter.js"></script>
<script type="text/javascript" src="../lib/consolex.js"></script> <script type="text/javascript" src="suites/BaseSpec.js"></script>
<script type="text/javascript" src="suites/CustomMatchersSpec.js"></script>
<script type="text/javascript" src="suites/EnvSpec.js"></script>
<script type="text/javascript" src="suites/ExceptionsSpec.js"></script>
<script type="text/javascript" src="suites/JsApiReporterSpec.js"></script>
<script type="text/javascript" src="suites/MatchersSpec.js"></script>
<script type="text/javascript" src="suites/MockClockSpec.js"></script>
<script type="text/javascript" src="suites/MultiReporterSpec.js"></script>
<script type="text/javascript" src="suites/NestedResultsSpec.js"></script>
<script type="text/javascript" src="suites/PrettyPrintSpec.js"></script>
<script type="text/javascript" src="suites/ReporterSpec.js"></script>
<script type="text/javascript" src="suites/RunnerSpec.js"></script>
<script type="text/javascript" src="suites/QueueSpec.js"></script>
<script type="text/javascript" src="suites/SpecSpec.js"></script>
<script type="text/javascript" src="suites/SpecRunningSpec.js"></script>
<script type="text/javascript" src="suites/SpySpec.js"></script>
<script type="text/javascript" src="suites/SuiteSpec.js"></script>
<script type="text/javascript" src="suites/TrivialReporterSpec.js"></script>
<script type="text/javascript" src="suites/TrivialConsoleReporterSpec.js"></script>
<script type="text/javascript" src="suites/WaitsForBlockSpec.js"></script>
<script type="text/javascript"> <script type="text/javascript">
(function () { (function() {
var suites = [
'suites/CustomMatchersSpec.js',
'suites/EnvSpec.js',
'suites/ExceptionsSpec.js',
'suites/JsApiReporterSpec.js',
'suites/MatchersSpec.js',
'suites/MultiReporterSpec.js',
'suites/NestedResultsSpec.js',
'suites/PrettyPrintSpec.js',
'suites/ReporterSpec.js',
'suites/RunnerSpec.js',
'suites/QueueSpec.js',
'suites/SpecSpec.js',
'suites/SpecRunningSpec.js',
'suites/SpySpec.js',
'suites/SuiteSpec.js',
'suites/TrivialReporterSpec.js',
];
for (var i = 0; i < suites.length; i++) {
jasmine.include(suites[i], true);
}
var jasmineEnv = jasmine.getEnv(); var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000; jasmineEnv.updateInterval = 1000;
@ -74,7 +57,7 @@
})(); })();
</script> </script>
<link href="../lib/jasmine.css" rel="stylesheet"/> <link href="../src/html/jasmine.css" rel="stylesheet"/>
</head> </head>
<body> <body>

View File

@ -1,24 +0,0 @@
local:
application_framework: :selenium
#
# Possible Sauce Labs configurations as of 2009/11/19
# From: http://saucelabs.com/products/docs/sauce-ondemand/browsers
# os: "Windows 2003"
# browser: "iexplore"
# browser-version: "6.", "7.", "8."
# browser: "firefox"
# browser-version: "2.", "3.0", "3.5"
# browser: "safari"
# browser-version: "3.", "4."
# browser: "opera"
# browser-version: "9."
# browser: "googlechrome"
# browser-version: ""
# os: "Linux"
# browser: "firefox"
# browser-version: "3."
saucelabs:
application_framework: :external
selenium_server_address: "saucelabs.com"
selenium_browser_key: '{"username": "--YOUR-SAUCELABS-USERNAME--", "access-key": "--YOUR-SAUCELABS-ACCESS-KEY--", "os": "Linux", "browser": "firefox", "browser-version": "3."}'
application_port: "80"

27
spec/suites/BaseSpec.js Normal file
View File

@ -0,0 +1,27 @@
describe("base.js", function() {
describe("jasmine.MessageResult", function() {
it("#toString should pretty-print and concatenate each part of the message", function() {
var values = ["log", "message", 123, {key: "value"}, "FTW!"];
var messageResult = new jasmine.MessageResult(values);
expect(messageResult.toString()).toEqual("log message 123 { key : 'value' } FTW!");
});
});
describe("jasmine.log", function() {
it("should accept n arguments", function() {
spyOn(jasmine.getEnv().currentSpec, 'log');
jasmine.log(1, 2, 3);
expect(jasmine.getEnv().currentSpec.log).toHaveBeenCalledWith(1, 2, 3);
});
});
describe("jasmine.getGlobal", function() {
it("should return the global object", function() {
var globalObject = (function() {
return this;
})();
expect(jasmine.getGlobal()).toBe(globalObject);
});
});
});

View File

@ -11,15 +11,21 @@ describe("Custom Matchers", function() {
var spec1, spec2, spec1Matcher, spec2Matcher; var spec1, spec2, spec1Matcher, spec2Matcher;
var suite = env.describe('some suite', function() { var suite = env.describe('some suite', function() {
env.beforeEach(function() { env.beforeEach(function() {
this.addMatchers({ matcherForSuite: function(expected) { this.addMatchers({
return "matcherForSuite: actual: " + this.actual + "; expected: " + expected; matcherForSuite: function(expected) {
} }); this.message = "matcherForSuite: actual: " + this.actual + "; expected: " + expected;
return true;
}
});
}); });
spec1 = env.it('spec with an expectation').runs(function () { spec1 = env.it('spec with an expectation').runs(function () {
this.addMatchers({ matcherForSpec: function(expected) { this.addMatchers({
return "matcherForSpec: actual: " + this.actual + "; expected: " + expected; matcherForSpec: function(expected) {
} }); this.message = "matcherForSpec: actual: " + this.actual + "; expected: " + expected;
return true;
}
});
spec1Matcher = this.expect("xxx"); spec1Matcher = this.expect("xxx");
}); });
@ -30,10 +36,13 @@ describe("Custom Matchers", function() {
suite.execute(); suite.execute();
expect(spec1Matcher.matcherForSuite("expected")).toEqual("matcherForSuite: actual: xxx; expected: expected"); spec1Matcher.matcherForSuite("expected");
expect(spec1Matcher.matcherForSpec("expected")).toEqual("matcherForSpec: actual: xxx; expected: expected"); expect(spec1Matcher.message).toEqual("matcherForSuite: actual: xxx; expected: expected");
spec1Matcher.matcherForSpec("expected");
expect(spec1Matcher.message).toEqual("matcherForSpec: actual: xxx; expected: expected");
expect(spec2Matcher.matcherForSuite("expected")).toEqual("matcherForSuite: actual: yyy; expected: expected"); spec2Matcher.matcherForSuite("expected");
expect(spec2Matcher.message).toEqual("matcherForSuite: actual: yyy; expected: expected");
expect(spec2Matcher.matcherForSpec).toBe(jasmine.undefined); expect(spec2Matcher.matcherForSpec).toBe(jasmine.undefined);
}); });
@ -85,28 +94,4 @@ describe("Custom Matchers", function() {
expect(matcherCallArgs).toEqual([[], ['arg'], ['arg1', 'arg2']]); expect(matcherCallArgs).toEqual([[], ['arg'], ['arg1', 'arg2']]);
}); });
describe("in the old style", function() {
it("should report deprecation a warning", function() {
var spec;
var suite = env.describe('some suite', function() {
spec = env.it('spec with an expectation').runs(function () {
this.addMatchers({
toBeTrue: function() {
this.report(this.actual === true, this.actual + " was not true.", "details");
}
});
this.expect(true).toBeTrue();
this.expect(false).toBeTrue();
});
});
suite.execute();
var passResult = new jasmine.ExpectationResult({passed: true, message: "Passed.", details: "details"});
var failResult = new jasmine.ExpectationResult({passed: false, message: "false was not true.", details: "details"});
failResult.trace = jasmine.any(Object);
expect(spec.results().getItems()).toEqual([passResult, failResult]);
});
});
}); });

View File

@ -57,12 +57,102 @@ describe("jasmine.Env", function() {
"revision": 8 "revision": 8
}); });
}); });
describe("versionString", function() {
it("should return a stringified version number", function() {
jasmine.version_ = {
"major": 1,
"minor": 9,
"build": 7,
"revision": 8
};
expect(env.versionString()).toEqual("1.9.7 revision 8");
});
it("should return a nice string when version is unknown", function() {
jasmine.version_ = null;
expect(env.versionString()).toEqual("version unknown");
});
});
}); });
it("should allow reporters to be registered", function() { it("should allow reporters to be registered", function() {
env.addReporter(fakeReporter); env.addReporter(fakeReporter);
env.reporter.log("message"); env.reporter.log("message");
expect(fakeReporter.log).wasCalledWith("message"); expect(fakeReporter.log).toHaveBeenCalledWith("message");
});
});
describe("equality testing", function() {
describe("with custom equality testers", function() {
var aObj, bObj, isEqual;
beforeEach(function() {
env.addEqualityTester(function(a, b) {
aObj = a;
bObj = b;
return isEqual;
});
});
it("should call the custom equality tester with two objects for comparison", function() {
env.equals_("1", "2");
expect(aObj).toEqual("1");
expect(bObj).toEqual("2");
});
describe("when the custom equality tester returns false", function() {
beforeEach(function() {
isEqual = false;
});
it("should give custom equality testers precedence", function() {
expect(env.equals_('abc', 'abc')).toBeFalsy();
var o = {};
expect(env.equals_(o, o)).toBeFalsy();
});
});
describe("when the custom equality tester returns true", function() {
beforeEach(function() {
isEqual = true;
});
it("should give custom equality testers precedence", function() {
expect(env.equals_('abc', 'def')).toBeTruthy();
expect(env.equals_(true, false)).toBeTruthy();
});
});
describe("when the custom equality tester returns undefined", function() {
beforeEach(function() {
isEqual = jasmine.undefined;
});
it("should use normal equality rules", function() {
expect(env.equals_('abc', 'abc')).toBeTruthy();
expect(env.equals_('abc', 'def')).toBeFalsy();
});
describe("even if there are several", function() {
beforeEach(function() {
env.addEqualityTester(function(a, b) { return jasmine.undefined; });
env.addEqualityTester(function(a, b) { return jasmine.undefined; });
});
it("should use normal equality rules", function() {
expect(env.equals_('abc', 'abc')).toBeTruthy();
expect(env.equals_('abc', 'def')).toBeFalsy();
});
});
});
it("should evaluate custom equality testers in the order they are declared", function() {
isEqual = false;
env.addEqualityTester(function(a, b) { return true; });
expect(env.equals_('abc', 'abc')).toBeFalsy();
});
}); });
}); });
}); });

View File

@ -3,7 +3,7 @@ describe('Exceptions:', function() {
beforeEach(function() { beforeEach(function() {
env = new jasmine.Env(); env = new jasmine.Env();
env.updateInterval = 0; env.updateInterval = 0;
}); });
it('jasmine.formatException formats Firefox exception messages as expected', function() { it('jasmine.formatException formats Firefox exception messages as expected', function() {
@ -89,9 +89,9 @@ describe('Exceptions:', function() {
expect(blockResults[0].message).toMatch(/fake error 1/); expect(blockResults[0].message).toMatch(/fake error 1/);
expect(specResults[1].passed()).toEqual(false); expect(specResults[1].passed()).toEqual(false);
var blockResults = specResults[1].getItems(); blockResults = specResults[1].getItems();
expect(blockResults[0].passed()).toEqual(false); expect(blockResults[0].passed()).toEqual(false);
expect(blockResults[0].message).toMatch(/fake error 2/), expect(blockResults[0].message).toMatch(/fake error 2/);
expect(blockResults[1].passed()).toEqual(true); expect(blockResults[1].passed()).toEqual(true);
expect(specResults[2].passed()).toEqual(true); expect(specResults[2].passed()).toEqual(true);
@ -101,7 +101,49 @@ describe('Exceptions:', function() {
expect(blockResults[0].message).toMatch(/fake error 3/); expect(blockResults[0].message).toMatch(/fake error 3/);
expect(specResults[4].passed()).toEqual(true); expect(specResults[4].passed()).toEqual(true);
}); });
it("should handle exceptions thrown directly in top-level describe blocks and continue", function () {
var suite = env.describe("a top level describe block that throws an exception", function () {
env.it("is a test that should pass", function () {
this.expect(true).toEqual(true);
});
throw new Error("top level error");
});
suite.execute();
var suiteResults = suite.results();
var specResults = suiteResults.getItems();
expect(suiteResults.passed()).toEqual(false);
expect(specResults.length).toEqual(2);
expect(specResults[1].description).toMatch(/encountered a declaration exception/);
});
it("should handle exceptions thrown directly in nested describe blocks and continue", function () {
var suite = env.describe("a top level describe", function () {
env.describe("a mid-level describe that throws an exception", function () {
env.it("is a test that should pass", function () {
this.expect(true).toEqual(true);
});
throw new Error("a mid-level error");
});
});
suite.execute();
var suiteResults = suite.results();
var specResults = suiteResults.getItems();
expect(suiteResults.passed()).toEqual(false);
expect(specResults.length).toEqual(1);
var nestedSpecResults = specResults[0].getItems();
expect(nestedSpecResults.length).toEqual(2);
expect(nestedSpecResults[1].description).toMatch(/encountered a declaration exception/);
});
}); });

View File

@ -1,49 +1,52 @@
describe('jasmine.jsApiReporter', function() { describe('jasmine.jsApiReporter', function() {
describe('results', function () { describe('results', function () {
var reporter, spec1, spec2, spec3, expectedSpec1Results, expectedSpec2Results; var reporter, spec1, spec2, spec3, expectedSpec1Results, expectedSpec2Results;
var env;
var suite, nestedSuite, nestedSpec;
beforeEach(function() { beforeEach(function() {
var env = new jasmine.Env(); env = new jasmine.Env();
env.updateInterval = 0; env.updateInterval = 0;
var suite = new jasmine.Suite(env);
spec1 = new jasmine.Spec(env, suite, 'spec 1'); suite = env.describe("top-level suite", function() {
spec1.runs(function () { spec1 = env.it("spec 1", function() {
this.expect(true).toEqual(true); this.expect(true).toEqual(true);
});
spec2 = env.it("spec 2", function() {
this.expect(true).toEqual(false);
});
nestedSuite = env.describe("nested suite", function() {
nestedSpec = env.it("nested spec", function() {
expect(true).toEqual(true);
});
});
spec3 = env.it("spec 3", function() {
this.log('some debug message');
});
}); });
reporter = new jasmine.JsApiReporter();
env.addReporter(reporter);
env.execute();
expectedSpec1Results = { expectedSpec1Results = {
messages: spec1.results().getItems(), messages: spec1.results().getItems(),
result: "passed" result: "passed"
}; };
spec2 = new jasmine.Spec(env, suite, 'spec 2');
spec2.runs(function () {
this.expect(true).toEqual(false);
});
expectedSpec2Results = { expectedSpec2Results = {
messages: spec2.results().getItems(), messages: spec2.results().getItems(),
result: "failed" result: "failed"
}; };
spec3 = new jasmine.Spec(env, suite, 'spec 3');
spec3.runs(function () {
this.log('some debug message')
});
spec1.execute();
spec2.execute();
spec3.execute();
reporter = new jasmine.JsApiReporter();
reporter.reportSpecResults(spec1);
reporter.reportSpecResults(spec2);
reporter.reportSpecResults(spec3);
}); });
it('resultForSpec() should return the result for the given spec', function () { it('resultForSpec() should return the result for the given spec', function () {
expect(reporter.resultsForSpec(spec1.id)).toEqual(expectedSpec1Results); expect(reporter.resultsForSpec(spec1.id)).toEqual(expectedSpec1Results);
expect(reporter.resultsForSpec(spec2.id)).toEqual(expectedSpec2Results); expect(reporter.resultsForSpec(spec2.id)).toEqual(expectedSpec2Results);
}); });
it('results() should return a hash of all results, indexed by spec id', function () { it('results() should return a hash of all results, indexed by spec id', function () {
@ -51,6 +54,23 @@ describe('jasmine.jsApiReporter', function() {
expect(reporter.results()[spec2.id]).toEqual(expectedSpec2Results); expect(reporter.results()[spec2.id]).toEqual(expectedSpec2Results);
}); });
it("should return nested suites as children of their parents", function() {
expect(reporter.suites()).toEqual([
{ id: 0, name: 'top-level suite', type: 'suite',
children: [
{ id: 0, name: 'spec 1', type: 'spec', children: [ ] },
{ id: 1, name: 'spec 2', type: 'spec', children: [ ] },
{ id: 1, name: 'nested suite', type: 'suite',
children: [
{ id: 2, name: 'nested spec', type: 'spec', children: [ ] }
]
},
{ id: 3, name: 'spec 3', type: 'spec', children: [ ] }
]
}
]);
});
describe("#summarizeResult_", function() { describe("#summarizeResult_", function() {
it("should summarize a passing result", function() { it("should summarize a passing result", function() {
var result = reporter.results()[spec1.id]; var result = reporter.results()[spec1.id];
@ -59,9 +79,9 @@ describe('jasmine.jsApiReporter', function() {
expect(summarizedResult.messages.length).toEqual(1); expect(summarizedResult.messages.length).toEqual(1);
expect(summarizedResult.messages[0].message).toEqual(result.messages[0].message); expect(summarizedResult.messages[0].message).toEqual(result.messages[0].message);
expect(summarizedResult.messages[0].passed).toBeTruthy(); expect(summarizedResult.messages[0].passed).toBeTruthy();
expect(summarizedResult.messages[0].type).toEqual('ExpectationResult'); expect(summarizedResult.messages[0].type).toEqual('expect');
expect(summarizedResult.messages[0].text).toEqual(jasmine.undefined); expect(summarizedResult.messages[0].text).toBeUndefined();
expect(summarizedResult.messages[0].trace.stack).toEqual(jasmine.undefined); expect(summarizedResult.messages[0].trace.stack).toBeUndefined();
}); });
it("should have a stack trace for failing specs", function() { it("should have a stack trace for failing specs", function() {
@ -75,6 +95,7 @@ describe('jasmine.jsApiReporter', function() {
var result = reporter.results()[spec3.id]; var result = reporter.results()[spec3.id];
var summarizedResult = reporter.summarizeResult_(result); var summarizedResult = reporter.summarizeResult_(result);
expect(summarizedResult.result).toEqual('passed'); expect(summarizedResult.result).toEqual('passed');
expect(summarizedResult.messages[0].type).toEqual('log');
expect(summarizedResult.messages[0].text).toEqual('some debug message'); expect(summarizedResult.messages[0].text).toEqual('some debug message');
}); });
}); });

View File

@ -10,6 +10,15 @@ describe("jasmine.Matchers", function() {
}); });
}); });
spyOn(spec, 'addMatcherResult'); spyOn(spec, 'addMatcherResult');
this.addMatchers({
toPass: function() {
return lastResult().passed();
},
toFail: function() {
return !lastResult().passed();
}
});
}); });
function match(value) { function match(value) {
@ -20,10 +29,19 @@ describe("jasmine.Matchers", function() {
return spec.addMatcherResult.mostRecentCall.args[0]; return spec.addMatcherResult.mostRecentCall.args[0];
} }
it("toEqual with primitives, objects, dates, html nodes, etc.", function() { function catchException(fn) {
expect(match(true).toEqual(true)).toEqual(true); try {
fn.call();
} catch (e) {
return e;
}
throw new Error("expected function to throw an exception");
}
expect(match({foo:'bar'}).toEqual(null)).toEqual(false); it("toEqual with primitives, objects, dates, etc.", function() {
expect(match(true).toEqual(true)).toPass();
expect(match({foo:'bar'}).toEqual(null)).toFail();
var functionA = function() { var functionA = function() {
return 'hi'; return 'hi';
@ -31,29 +49,39 @@ describe("jasmine.Matchers", function() {
var functionB = function() { var functionB = function() {
return 'hi'; return 'hi';
}; };
expect(match({foo:functionA}).toEqual({foo:functionB})).toEqual(false); expect(match({foo:functionA}).toEqual({foo:functionB})).toFail();
expect(match({foo:functionA}).toEqual({foo:functionA})).toEqual(true); expect(match({foo:functionA}).toEqual({foo:functionA})).toPass();
expect((match(false).toEqual(true))).toEqual(false); expect((match(false).toEqual(true))).toFail();
var circularGraph = {}; var circularGraph = {};
circularGraph.referenceToSelf = circularGraph; circularGraph.referenceToSelf = circularGraph;
expect((match(circularGraph).toEqual(circularGraph))).toEqual(true); expect((match(circularGraph).toEqual(circularGraph))).toPass();
expect((match(new Date(2008, 1, 3, 15, 17, 19, 1234)).toEqual(new Date(2009, 1, 3, 15, 17, 19, 1234)))).toFail();
expect((match(new Date(2008, 1, 3, 15, 17, 19, 1234)).toEqual(new Date(2008, 1, 3, 15, 17, 19, 1234)))).toPass();
expect(match(true).toNotEqual(false)).toPass();
expect((match(true).toNotEqual(true))).toFail();
expect((match(['a', 'b']).toEqual(['a', jasmine.undefined]))).toFail();
expect((match(['a', 'b']).toEqual(['a', 'b', jasmine.undefined]))).toFail();
expect((match("cat").toEqual("cat"))).toPass();
expect((match("cat").toNotEqual("cat"))).toFail();
expect((match(5).toEqual(5))).toPass();
expect((match(parseInt('5', 10)).toEqual(5))).toPass();
expect((match(5).toNotEqual(5))).toFail();
expect((match(parseInt('5', 10)).toNotEqual(5))).toFail();
});
it("toEqual with DOM nodes", function() {
var nodeA = document.createElement('div'); var nodeA = document.createElement('div');
var nodeB = document.createElement('div'); var nodeB = document.createElement('div');
expect((match(nodeA).toEqual(nodeA))).toEqual(true); expect((match(nodeA).toEqual(nodeA))).toPass();
expect((match(nodeA).toEqual(nodeB))).toEqual(false); expect((match(nodeA).toEqual(nodeB))).toFail();
expect((match(new Date(2008, 1, 3, 15, 17, 19, 1234)).toEqual(new Date(2009, 1, 3, 15, 17, 19, 1234)))).toEqual(false);
expect((match(new Date(2008, 1, 3, 15, 17, 19, 1234)).toEqual(new Date(2008, 1, 3, 15, 17, 19, 1234)))).toEqual(true);
expect(match(true).toNotEqual(false)).toEqual(true);
expect((match(true).toNotEqual(true))).toEqual(false);
expect((match(['a', 'b']).toEqual(['a', jasmine.undefined]))).toEqual(false);
expect((match(['a', 'b']).toEqual(['a', 'b', jasmine.undefined]))).toEqual(false);
}); });
it("toEqual to build an Expectation Result", function() { it("toEqual to build an Expectation Result", function() {
@ -65,7 +93,7 @@ describe("jasmine.Matchers", function() {
var result = lastResult(); var result = lastResult();
expect(result.matcherName).toEqual("toEqual"); expect(result.matcherName).toEqual("toEqual");
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.message).toMatch(jasmine.pp(actual)); expect(result.message).toMatch(jasmine.pp(actual));
expect(result.message).toMatch(jasmine.pp(expected)); expect(result.message).toMatch(jasmine.pp(expected));
expect(result.expected).toEqual(expected); expect(result.expected).toEqual(expected);
@ -80,7 +108,7 @@ describe("jasmine.Matchers", function() {
var result = lastResult(); var result = lastResult();
expect(result.matcherName).toEqual("toNotEqual"); expect(result.matcherName).toEqual("toNotEqual");
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.message).toMatch(jasmine.pp(str)); expect(result.message).toMatch(jasmine.pp(str));
expect(result.message).toMatch('not'); expect(result.message).toMatch('not');
expect(result.expected).toEqual(str); expect(result.expected).toEqual(str);
@ -92,12 +120,12 @@ describe("jasmine.Matchers", function() {
var b = {}; var b = {};
//noinspection UnnecessaryLocalVariableJS //noinspection UnnecessaryLocalVariableJS
var c = a; var c = a;
expect((match(a).toBe(b))).toEqual(false); expect((match(a).toBe(b))).toFail();
expect((match(a).toBe(a))).toEqual(true); expect((match(a).toBe(a))).toPass();
expect((match(a).toBe(c))).toEqual(true); expect((match(a).toBe(c))).toPass();
expect((match(a).toNotBe(b))).toEqual(true); expect((match(a).toNotBe(b))).toPass();
expect((match(a).toNotBe(a))).toEqual(false); expect((match(a).toNotBe(a))).toFail();
expect((match(a).toNotBe(c))).toEqual(false); expect((match(a).toNotBe(c))).toFail();
}); });
it("toBe to build an ExpectationResult", function() { it("toBe to build an ExpectationResult", function() {
@ -109,7 +137,7 @@ describe("jasmine.Matchers", function() {
var result = lastResult(); var result = lastResult();
expect(result.matcherName).toEqual("toBe"); expect(result.matcherName).toEqual("toBe");
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.message).toMatch(jasmine.pp(actual)); expect(result.message).toMatch(jasmine.pp(actual));
expect(result.message).toMatch(jasmine.pp(expected)); expect(result.message).toMatch(jasmine.pp(expected));
expect(result.expected).toEqual(expected); expect(result.expected).toEqual(expected);
@ -124,24 +152,24 @@ describe("jasmine.Matchers", function() {
var result = lastResult(); var result = lastResult();
expect(result.matcherName).toEqual("toNotBe"); expect(result.matcherName).toEqual("toNotBe");
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.message).toMatch(str); expect(result.message).toMatch(str);
expect(result.expected).toEqual(str); expect(result.expected).toEqual(str);
expect(result.actual).toEqual(str); expect(result.actual).toEqual(str);
}); });
it("toMatch and #toNotMatch should perform regular expression matching on strings", function() { it("toMatch and #toNotMatch should perform regular expression matching on strings", function() {
expect((match('foobarbel').toMatch(/bar/))).toEqual(true); expect((match('foobarbel').toMatch(/bar/))).toPass();
expect((match('foobazbel').toMatch(/bar/))).toEqual(false); expect((match('foobazbel').toMatch(/bar/))).toFail();
expect((match('foobarbel').toMatch("bar"))).toEqual(true); expect((match('foobarbel').toMatch("bar"))).toPass();
expect((match('foobazbel').toMatch("bar"))).toEqual(false); expect((match('foobazbel').toMatch("bar"))).toFail();
expect((match('foobarbel').toNotMatch(/bar/))).toEqual(false); expect((match('foobarbel').toNotMatch(/bar/))).toFail();
expect((match('foobazbel').toNotMatch(/bar/))).toEqual(true); expect((match('foobazbel').toNotMatch(/bar/))).toPass();
expect((match('foobarbel').toNotMatch("bar"))).toEqual(false); expect((match('foobarbel').toNotMatch("bar"))).toFail();
expect((match('foobazbel').toNotMatch("bar"))).toEqual(true); expect((match('foobazbel').toNotMatch("bar"))).toPass();
}); });
it("toMatch w/ RegExp to build an ExpectationResult", function() { it("toMatch w/ RegExp to build an ExpectationResult", function() {
@ -153,7 +181,7 @@ describe("jasmine.Matchers", function() {
var result = lastResult(); var result = lastResult();
expect(result.matcherName).toEqual("toMatch"); expect(result.matcherName).toEqual("toMatch");
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.message).toMatch(jasmine.pp(actual)); expect(result.message).toMatch(jasmine.pp(actual));
expect(result.message).toMatch(expected.toString()); expect(result.message).toMatch(expected.toString());
expect(result.expected).toEqual(expected); expect(result.expected).toEqual(expected);
@ -169,7 +197,7 @@ describe("jasmine.Matchers", function() {
var result = lastResult(); var result = lastResult();
expect(result.matcherName).toEqual("toMatch"); expect(result.matcherName).toEqual("toMatch");
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.message).toEqual("Expected 'a' to match 'b'."); expect(result.message).toEqual("Expected 'a' to match 'b'.");
expect(result.expected).toEqual(expected); expect(result.expected).toEqual(expected);
expect(result.actual).toEqual(actual); expect(result.actual).toEqual(actual);
@ -184,7 +212,7 @@ describe("jasmine.Matchers", function() {
var result = lastResult(); var result = lastResult();
expect(result.matcherName).toEqual("toNotMatch"); expect(result.matcherName).toEqual("toNotMatch");
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.message).toEqual("Expected 'a' to not match /a/."); expect(result.message).toEqual("Expected 'a' to not match /a/.");
expect(result.expected).toEqual(expected); expect(result.expected).toEqual(expected);
expect(result.actual).toEqual(actual); expect(result.actual).toEqual(actual);
@ -198,15 +226,15 @@ describe("jasmine.Matchers", function() {
var result = lastResult(); var result = lastResult();
expect(result.matcherName).toEqual("toNotMatch"); expect(result.matcherName).toEqual("toNotMatch");
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.message).toEqual("Expected 'a' to not match 'a'."); expect(result.message).toEqual("Expected 'a' to not match 'a'.");
expect(result.expected).toEqual(str); expect(result.expected).toEqual(str);
expect(result.actual).toEqual(str); expect(result.actual).toEqual(str);
}); });
it("toBeDefined", function() { it("toBeDefined", function() {
expect(match('foo').toBeDefined()).toEqual(true); expect(match('foo').toBeDefined()).toPass();
expect(match(jasmine.undefined).toBeDefined()).toEqual(false); expect(match(jasmine.undefined).toBeDefined()).toFail();
}); });
it("toBeDefined to build an ExpectationResult", function() { it("toBeDefined to build an ExpectationResult", function() {
@ -216,20 +244,20 @@ describe("jasmine.Matchers", function() {
var result = lastResult(); var result = lastResult();
expect(result.matcherName).toEqual("toBeDefined"); expect(result.matcherName).toEqual("toBeDefined");
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.message).toEqual('Expected undefined to be defined.'); expect(result.message).toEqual('Expected undefined to be defined.');
expect(result.actual).toEqual(jasmine.undefined); expect(result.actual).toEqual(jasmine.undefined);
}); });
it("toBeUndefined", function() { it("toBeUndefined", function() {
expect(match('foo').toBeUndefined()).toEqual(false); expect(match('foo').toBeUndefined()).toFail();
expect(match(jasmine.undefined).toBeUndefined()).toEqual(true); expect(match(jasmine.undefined).toBeUndefined()).toPass();
}); });
it("toBeNull", function() { it("toBeNull", function() {
expect(match(null).toBeNull()).toEqual(true); expect(match(null).toBeNull()).toPass();
expect(match(jasmine.undefined).toBeNull()).toEqual(false); expect(match(jasmine.undefined).toBeNull()).toFail();
expect(match("foo").toBeNull()).toEqual(false); expect(match("foo").toBeNull()).toFail();
}); });
it("toBeNull w/ String to build an ExpectationResult", function() { it("toBeNull w/ String to build an ExpectationResult", function() {
@ -240,7 +268,7 @@ describe("jasmine.Matchers", function() {
var result = lastResult(); var result = lastResult();
expect(result.matcherName).toEqual("toBeNull"); expect(result.matcherName).toEqual("toBeNull");
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.message).toMatch(jasmine.pp(actual)); expect(result.message).toMatch(jasmine.pp(actual));
expect(result.message).toMatch('null'); expect(result.message).toMatch('null');
expect(result.actual).toEqual(actual); expect(result.actual).toEqual(actual);
@ -254,18 +282,18 @@ describe("jasmine.Matchers", function() {
var result = lastResult(); var result = lastResult();
expect(result.matcherName).toEqual("toBeNull"); expect(result.matcherName).toEqual("toBeNull");
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.message).toMatch(jasmine.pp(actual)); expect(result.message).toMatch(jasmine.pp(actual));
expect(result.message).toMatch('null'); expect(result.message).toMatch('null');
expect(result.actual).toEqual(actual); expect(result.actual).toEqual(actual);
}); });
it("toBeFalsy", function() { it("toBeFalsy", function() {
expect(match(false).toBeFalsy()).toEqual(true); expect(match(false).toBeFalsy()).toPass();
expect(match(true).toBeFalsy()).toEqual(false); expect(match(true).toBeFalsy()).toFail();
expect(match(jasmine.undefined).toBeFalsy()).toEqual(true); expect(match(jasmine.undefined).toBeFalsy()).toPass();
expect(match(0).toBeFalsy()).toEqual(true); expect(match(0).toBeFalsy()).toPass();
expect(match("").toBeFalsy()).toEqual(true); expect(match("").toBeFalsy()).toPass();
}); });
it("toBeFalsy to build an ExpectationResult", function() { it("toBeFalsy to build an ExpectationResult", function() {
@ -276,21 +304,21 @@ describe("jasmine.Matchers", function() {
var result = lastResult(); var result = lastResult();
expect(result.matcherName).toEqual("toBeFalsy"); expect(result.matcherName).toEqual("toBeFalsy");
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.message).toMatch(jasmine.pp(actual)); expect(result.message).toMatch(jasmine.pp(actual));
expect(result.message).toMatch('falsy'); expect(result.message).toMatch('falsy');
expect(result.actual).toEqual(actual); expect(result.actual).toEqual(actual);
}); });
it("toBeTruthy", function() { it("toBeTruthy", function() {
expect(match(false).toBeTruthy()).toEqual(false); expect(match(false).toBeTruthy()).toFail();
expect(match(true).toBeTruthy()).toEqual(true); expect(match(true).toBeTruthy()).toPass();
expect(match(jasmine.undefined).toBeTruthy()).toEqual(false); expect(match(jasmine.undefined).toBeTruthy()).toFail();
expect(match(0).toBeTruthy()).toEqual(false); expect(match(0).toBeTruthy()).toFail();
expect(match("").toBeTruthy()).toEqual(false); expect(match("").toBeTruthy()).toFail();
expect(match("hi").toBeTruthy()).toEqual(true); expect(match("hi").toBeTruthy()).toPass();
expect(match(5).toBeTruthy()).toEqual(true); expect(match(5).toBeTruthy()).toPass();
expect(match({foo: 1}).toBeTruthy()).toEqual(true); expect(match({foo: 1}).toBeTruthy()).toPass();
}); });
it("toBeTruthy to build an ExpectationResult", function() { it("toBeTruthy to build an ExpectationResult", function() {
@ -300,69 +328,71 @@ describe("jasmine.Matchers", function() {
var result = lastResult(); var result = lastResult();
expect(result.matcherName).toEqual("toBeTruthy"); expect(result.matcherName).toEqual("toBeTruthy");
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.message).toEqual("Expected false to be truthy."); expect(result.message).toEqual("Expected false to be truthy.");
expect(result.actual).toEqual(false); expect(result.actual).toFail();
}); });
it("toEqual", function() { it("toEqual", function() {
expect(match(jasmine.undefined).toEqual(jasmine.undefined)).toEqual(true); expect(match(jasmine.undefined).toEqual(jasmine.undefined)).toPass();
expect(match({foo:'bar'}).toEqual({foo:'bar'})).toEqual(true); expect(match({foo:'bar'}).toEqual({foo:'bar'})).toPass();
expect(match("foo").toEqual({bar: jasmine.undefined})).toEqual(false); expect(match("foo").toEqual({bar: jasmine.undefined})).toFail();
expect(match({foo: jasmine.undefined}).toEqual("goo")).toEqual(false); expect(match({foo: jasmine.undefined}).toEqual("goo")).toFail();
expect(match({foo: {bar :jasmine.undefined}}).toEqual("goo")).toEqual(false); expect(match({foo: {bar :jasmine.undefined}}).toEqual("goo")).toFail();
}); });
it("toEqual with jasmine.any()", function() { it("toEqual with jasmine.any()", function() {
expect(match("foo").toEqual(jasmine.any(String))).toEqual(true); expect(match("foo").toEqual(jasmine.any(String))).toPass();
expect(match(3).toEqual(jasmine.any(Number))).toEqual(true); expect(match(3).toEqual(jasmine.any(Number))).toPass();
expect(match("foo").toEqual(jasmine.any(Function))).toEqual(false); expect(match("foo").toEqual(jasmine.any(Function))).toFail();
expect(match("foo").toEqual(jasmine.any(Object))).toEqual(false); expect(match("foo").toEqual(jasmine.any(Object))).toFail();
expect(match({someObj:'foo'}).toEqual(jasmine.any(Object))).toEqual(true); expect(match({someObj:'foo'}).toEqual(jasmine.any(Object))).toPass();
expect(match({someObj:'foo'}).toEqual(jasmine.any(Function))).toEqual(false); expect(match({someObj:'foo'}).toEqual(jasmine.any(Function))).toFail();
expect(match(function() { expect(match(
}).toEqual(jasmine.any(Object))).toEqual(false); function() {
expect(match(["foo", "goo"]).toEqual(["foo", jasmine.any(String)])).toEqual(true); }).toEqual(jasmine.any(Object))).toFail();
expect(match(function() { expect(match(["foo", "goo"]).toEqual(["foo", jasmine.any(String)])).toPass();
}).toEqual(jasmine.any(Function))).toEqual(true); expect(match(
function() {
}).toEqual(jasmine.any(Function))).toPass();
expect(match(["a", function() { expect(match(["a", function() {
}]).toEqual(["a", jasmine.any(Function)])).toEqual(true); }]).toEqual(["a", jasmine.any(Function)])).toPass();
}); });
it("toEqual handles circular objects ok", function() { it("toEqual handles circular objects ok", function() {
expect(match({foo: "bar", baz: jasmine.undefined}).toEqual({foo: "bar", baz: jasmine.undefined})).toEqual(true); expect(match({foo: "bar", baz: jasmine.undefined}).toEqual({foo: "bar", baz: jasmine.undefined})).toPass();
expect(match({foo:['bar','baz','quux']}).toEqual({foo:['bar','baz','quux']})).toEqual(true); expect(match({foo:['bar','baz','quux']}).toEqual({foo:['bar','baz','quux']})).toPass();
expect(match({foo: {bar:'baz'}, quux:'corge'}).toEqual({foo:{bar:'baz'}, quux:'corge'})).toEqual(true); expect(match({foo: {bar:'baz'}, quux:'corge'}).toEqual({foo:{bar:'baz'}, quux:'corge'})).toPass();
var circularObject = {}; var circularObject = {};
var secondCircularObject = {}; var secondCircularObject = {};
circularObject.field = circularObject; circularObject.field = circularObject;
secondCircularObject.field = secondCircularObject; secondCircularObject.field = secondCircularObject;
expect(match(circularObject).toEqual(secondCircularObject)).toEqual(true); expect(match(circularObject).toEqual(secondCircularObject)).toPass();
}); });
it("toNotEqual as slightly surprising behavior, but is it intentional?", function() { it("toNotEqual as slightly surprising behavior, but is it intentional?", function() {
expect(match({x:"x", y:"y", z:"w"}).toNotEqual({x:"x", y:"y", z:"z"})).toEqual(true); expect(match({x:"x", y:"y", z:"w"}).toNotEqual({x:"x", y:"y", z:"z"})).toPass();
expect(match({x:"x", y:"y", w:"z"}).toNotEqual({x:"x", y:"y", z:"z"})).toEqual(true); expect(match({x:"x", y:"y", w:"z"}).toNotEqual({x:"x", y:"y", z:"z"})).toPass();
expect(match({x:"x", y:"y", z:"z"}).toNotEqual({w: "w", x:"x", y:"y", z:"z"})).toEqual(true); expect(match({x:"x", y:"y", z:"z"}).toNotEqual({w: "w", x:"x", y:"y", z:"z"})).toPass();
expect(match({w: "w", x:"x", y:"y", z:"z"}).toNotEqual({x:"x", y:"y", z:"z"})).toEqual(true); expect(match({w: "w", x:"x", y:"y", z:"z"}).toNotEqual({x:"x", y:"y", z:"z"})).toPass();
}); });
it("toEqual handles arrays", function() { it("toEqual handles arrays", function() {
expect(match([1, "A"]).toEqual([1, "A"])).toEqual(true); expect(match([1, "A"]).toEqual([1, "A"])).toPass();
}); });
it("toContain and toNotContain", function() { it("toContain and toNotContain", function() {
expect(match('ABC').toContain('A')).toEqual(true); expect(match('ABC').toContain('A')).toPass();
expect(match('ABC').toContain('X')).toEqual(false); expect(match('ABC').toContain('X')).toFail();
expect(match(['A', 'B', 'C']).toContain('A')).toEqual(true); expect(match(['A', 'B', 'C']).toContain('A')).toPass();
expect(match(['A', 'B', 'C']).toContain('F')).toEqual(false); expect(match(['A', 'B', 'C']).toContain('F')).toFail();
expect(match(['A', 'B', 'C']).toNotContain('F')).toEqual(true); expect(match(['A', 'B', 'C']).toNotContain('F')).toPass();
expect(match(['A', 'B', 'C']).toNotContain('A')).toEqual(false); expect(match(['A', 'B', 'C']).toNotContain('A')).toFail();
expect(match(['A', {some:'object'}, 'C']).toContain({some:'object'})).toEqual(true); expect(match(['A', {some:'object'}, 'C']).toContain({some:'object'})).toPass();
expect(match(['A', {some:'object'}, 'C']).toContain({some:'other object'})).toEqual(false); expect(match(['A', {some:'object'}, 'C']).toContain({some:'other object'})).toFail();
}); });
it("toContain to build an ExpectationResult", function() { it("toContain to build an ExpectationResult", function() {
@ -374,7 +404,7 @@ describe("jasmine.Matchers", function() {
var result = lastResult(); var result = lastResult();
expect(result.matcherName).toEqual("toContain"); expect(result.matcherName).toEqual("toContain");
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.message).toMatch(jasmine.pp(actual)); expect(result.message).toMatch(jasmine.pp(actual));
expect(result.message).toMatch('contain'); expect(result.message).toMatch('contain');
expect(result.message).toMatch(jasmine.pp(expected)); expect(result.message).toMatch(jasmine.pp(expected));
@ -391,7 +421,7 @@ describe("jasmine.Matchers", function() {
var result = lastResult(); var result = lastResult();
expect(result.matcherName).toEqual("toNotContain"); expect(result.matcherName).toEqual("toNotContain");
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.message).toMatch(jasmine.pp(actual)); expect(result.message).toMatch(jasmine.pp(actual));
expect(result.message).toMatch('not contain'); expect(result.message).toMatch('not contain');
expect(result.message).toMatch(jasmine.pp(expected)); expect(result.message).toMatch(jasmine.pp(expected));
@ -400,9 +430,9 @@ describe("jasmine.Matchers", function() {
}); });
it("toBeLessThan should pass if actual is less than expected", function() { it("toBeLessThan should pass if actual is less than expected", function() {
expect(match(37).toBeLessThan(42)).toEqual(true); expect(match(37).toBeLessThan(42)).toPass();
expect(match(37).toBeLessThan(-42)).toEqual(false); expect(match(37).toBeLessThan(-42)).toFail();
expect(match(37).toBeLessThan(37)).toEqual(false); expect(match(37).toBeLessThan(37)).toFail();
}); });
it("toBeLessThan to build an ExpectationResult", function() { it("toBeLessThan to build an ExpectationResult", function() {
@ -414,7 +444,7 @@ describe("jasmine.Matchers", function() {
var result = lastResult(); var result = lastResult();
expect(result.matcherName).toEqual("toBeLessThan"); expect(result.matcherName).toEqual("toBeLessThan");
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.message).toMatch(jasmine.pp(actual) + ' to be less than'); expect(result.message).toMatch(jasmine.pp(actual) + ' to be less than');
expect(result.message).toMatch(jasmine.pp(expected)); expect(result.message).toMatch(jasmine.pp(expected));
expect(result.actual).toEqual(actual); expect(result.actual).toEqual(actual);
@ -422,9 +452,9 @@ describe("jasmine.Matchers", function() {
}); });
it("toBeGreaterThan should pass if actual is greater than expected", function() { it("toBeGreaterThan should pass if actual is greater than expected", function() {
expect(match(37).toBeGreaterThan(42)).toEqual(false); expect(match(37).toBeGreaterThan(42)).toFail();
expect(match(37).toBeGreaterThan(-42)).toEqual(true); expect(match(37).toBeGreaterThan(-42)).toPass();
expect(match(37).toBeGreaterThan(37)).toEqual(false); expect(match(37).toBeGreaterThan(37)).toFail();
}); });
it("toBeGreaterThan to build an ExpectationResult", function() { it("toBeGreaterThan to build an ExpectationResult", function() {
@ -436,54 +466,137 @@ describe("jasmine.Matchers", function() {
var result = lastResult(); var result = lastResult();
expect(result.matcherName).toEqual("toBeGreaterThan"); expect(result.matcherName).toEqual("toBeGreaterThan");
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.message).toMatch(jasmine.pp(actual) + ' to be greater than'); expect(result.message).toMatch(jasmine.pp(actual) + ' to be greater than');
expect(result.message).toMatch(jasmine.pp(expected)); expect(result.message).toMatch(jasmine.pp(expected));
expect(result.actual).toEqual(actual); expect(result.actual).toEqual(actual);
expect(result.expected).toEqual(expected); expect(result.expected).toEqual(expected);
}); });
it("toThrow", function() { describe("toBeCloseTo", function() {
var expected = match(function() { it("returns 'true' iff actual and expected are equal within 2 decimal points of precision", function() {
throw new Error("Fake Error"); expect(0).toBeCloseTo(0);
expect(1).toBeCloseTo(1);
expect(1).not.toBeCloseTo(1.1);
expect(1).not.toBeCloseTo(1.01);
expect(1).toBeCloseTo(1.001);
expect(1.23).toBeCloseTo(1.234);
expect(1.23).toBeCloseTo(1.233);
expect(1.23).toBeCloseTo(1.232);
expect(1.23).not.toBeCloseTo(1.24);
expect(-1.23).toBeCloseTo(-1.234);
expect(-1.23).not.toBeCloseTo(-1.24);
}); });
expect(expected.toThrow()).toEqual(true);
expect(expected.toThrow("Fake Error")).toEqual(true);
expect(expected.toThrow(new Error("Fake Error"))).toEqual(true);
expect(expected.toThrow("Other Error")).toEqual(false); it("accepts an optional precision argument", function() {
var result = lastResult(); expect(1).toBeCloseTo(1.1, 0);
expect(result.message).toMatch("Other Error"); expect(1.2).toBeCloseTo(1.23, 1);
expect(expected.toThrow(new Error("Other Error"))).toEqual(false); expect(1.234).toBeCloseTo(1.2343, 3);
result = lastResult(); expect(1.234).not.toBeCloseTo(1.233, 3);
expect(result.message).toMatch("Other Error"); });
var exception; it("rounds", function() {
try { expect(1.23).toBeCloseTo(1.229);
(function () { expect(1.23).toBeCloseTo(1.226);
new jasmine.Matchers(env, 'not-a-function', spec).toThrow(); expect(1.23).toBeCloseTo(1.225);
})(); expect(1.23).not.toBeCloseTo(1.2249999);
} catch (e) {
exception = e;
}
expect(exception).toBeDefined(); expect(1.23).toBeCloseTo(1.234);
expect(exception.message).toEqual('Actual is not a function'); expect(1.23).toBeCloseTo(1.2349999);
expect(1.23).not.toBeCloseTo(1.235);
expect(-1.23).toBeCloseTo(-1.234);
expect(-1.23).not.toBeCloseTo(-1.235);
expect(-1.23).not.toBeCloseTo(-1.236);
});
});
describe("toThrow", function() {
describe("when code block throws an exception", function() {
var throwingFn;
beforeEach(function() {
throwingFn = function() {
throw new Error("Fake Error");
};
});
it("should match any exception", function() {
expect(match(throwingFn).toThrow()).toPass();
});
it("should match exceptions specified by message", function() {
expect(match(throwingFn).toThrow("Fake Error")).toPass();
expect(match(throwingFn).toThrow("Other Error")).toFail();
expect(lastResult().message).toMatch("Other Error");
});
it("should match exceptions specified by Error", function() {
expect(match(throwingFn).toThrow(new Error("Fake Error"))).toPass();
expect(match(throwingFn).toThrow(new Error("Other Error"))).toFail();
expect(lastResult().message).toMatch("Other Error");
});
describe("and matcher is inverted with .not", function() {
it("should match any exception", function() {
expect(match(throwingFn).not.toThrow()).toFail();
expect(lastResult().message).toMatch(/Expected function not to throw an exception/);
});
it("should match exceptions specified by message", function() {
expect(match(throwingFn).not.toThrow("Fake Error")).toFail();
// expect(lastResult().message).toMatch(/Expected function not to throw Fake Error./);
expect(match(throwingFn).not.toThrow("Other Error")).toPass();
});
it("should match exceptions specified by Error", function() {
expect(match(throwingFn).not.toThrow(new Error("Fake Error"))).toFail();
// expect(lastResult().message).toMatch("Other Error");
expect(match(throwingFn).not.toThrow(new Error("Other Error"))).toPass();
});
});
});
describe("when actual is not a function", function() {
it("should fail with an exception", function() {
var exception = catchException(function() {
match('not-a-function').toThrow();
});
expect(exception).toBeDefined();
expect(exception.message).toEqual('Actual is not a function');
});
describe("and matcher is inverted with .not", function() {
it("should fail with an exception", function() {
var exception = catchException(function() {
match('not-a-function').not.toThrow();
});
expect(exception).toBeDefined();
expect(exception.message).toEqual('Actual is not a function');
});
});
});
expect(match(function() { describe("when code block does not throw an exception", function() {
}).toThrow()).toEqual(false); it("should fail (or pass when inverted with .not)", function() {
result = lastResult(); expect(match(
expect(result.message).toEqual('Expected function to throw an exception.'); function() {
}).toThrow()).toFail();
expect(lastResult().message).toEqual('Expected function to throw an exception.');
});
});
}); });
describe(".not.matcher", function() { describe(".not.matcher", function() {
it("should invert the sense of any matcher", function() { it("should invert the sense of any matcher", function() {
expect(match(37).not.toBeGreaterThan(42)).toEqual(true); expect(match(37).not.toBeGreaterThan(42)).toPass();
expect(match(42).not.toBeGreaterThan(37)).toEqual(false); expect(match(42).not.toBeGreaterThan(37)).toFail();
expect(match("abc").not.toEqual("def")).toEqual(true); expect(match("abc").not.toEqual("def")).toPass();
expect(match("abc").not.toEqual("abc")).toEqual(false); expect(match("abc").not.toEqual("abc")).toFail();
}); });
it("should provide an inverted default message", function() { it("should provide an inverted default message", function() {
@ -513,22 +626,6 @@ describe("jasmine.Matchers", function() {
match(false).not.custom(); match(false).not.custom();
expect(lastResult().message).toEqual("Passed."); expect(lastResult().message).toEqual("Passed.");
}); });
it("should make old-style custom matchers blow up, but only when negated", function() {
spec.addMatchers({
custom: function() {
this.report();
}
});
expect(function() {
match(true).custom();
}).not.toThrow();
expect(function() {
match(true).not.custom();
}).toThrow();
});
}); });
describe("spy matchers >>", function() { describe("spy matchers >>", function() {
@ -543,70 +640,87 @@ describe("jasmine.Matchers", function() {
function shouldThrowAnExceptionWhenInvokedOnANonSpy(methodName) { function shouldThrowAnExceptionWhenInvokedOnANonSpy(methodName) {
return function() { return function() {
expect(function() { expect(
match(TestClass.normalFunction)[methodName](); function() {
}).toThrow('Expected a spy, but got Function.'); match(TestClass.normalFunction)[methodName]();
}).toThrow('Expected a spy, but got Function.');
expect(function() { expect(
match(jasmine.undefined)[methodName](); function() {
}).toThrow('Expected a spy, but got undefined.'); match(jasmine.undefined)[methodName]();
}).toThrow('Expected a spy, but got undefined.');
expect(function() { expect(
match({some:'object'})[methodName](); function() {
}).toThrow('Expected a spy, but got { some : \'object\' }.'); match({some:'object'})[methodName]();
}).toThrow('Expected a spy, but got { some : \'object\' }.');
expect(function() { expect(
match("<b>")[methodName](); function() {
}).toThrow('Expected a spy, but got \'<b>\'.'); match("<b>")[methodName]();
}).toThrow('Expected a spy, but got \'<b>\'.');
}; };
} }
describe("wasCalled", function() { describe("toHaveBeenCalled", function() {
it("should pass iff the spy was called", function() { it("should pass if the spy was called", function() {
expect(match(TestClass.spyFunction).wasCalled()).toEqual(false); expect(match(TestClass.spyFunction).toHaveBeenCalled()).toFail();
TestClass.spyFunction(); TestClass.spyFunction();
expect(match(TestClass.spyFunction).wasCalled()).toEqual(true); expect(match(TestClass.spyFunction).toHaveBeenCalled()).toPass();
}); });
it("should throw an exception when invoked with any arguments", function() { it("should throw an exception when invoked with any arguments", function() {
expect(function() { expect(
match(TestClass.normalFunction).wasCalled("unwanted argument"); function() {
}).toThrow('wasCalled does not take arguments, use wasCalledWith'); match(TestClass.normalFunction).toHaveBeenCalled("unwanted argument");
}).toThrow('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith');
}); });
it('should throw an exception when invoked on a non-spy', shouldThrowAnExceptionWhenInvokedOnANonSpy('wasCalled')); it('should throw an exception when invoked on a non-spy', shouldThrowAnExceptionWhenInvokedOnANonSpy('toHaveBeenCalled'));
}); });
describe("wasCalled", function() {
it("should alias toHaveBeenCalled", function() {
spyOn(TestClass, 'normalFunction');
TestClass.normalFunction();
expect(TestClass.normalFunction).wasCalled();
});
});
describe("wasNotCalled", function() { describe("wasNotCalled", function() {
it("should pass iff the spy was not called", function() { it("should pass iff the spy was not called", function() {
expect(match(TestClass.spyFunction).wasNotCalled()).toEqual(true); expect(match(TestClass.spyFunction).wasNotCalled()).toPass();
TestClass.spyFunction(); TestClass.spyFunction();
expect(match(TestClass.spyFunction).wasNotCalled()).toEqual(false); expect(match(TestClass.spyFunction).wasNotCalled()).toFail();
}); });
it("should throw an exception when invoked with any arguments", function() { it("should throw an exception when invoked with any arguments", function() {
expect(function() { expect(
match(TestClass.normalFunction).wasNotCalled("unwanted argument"); function() {
}).toThrow('wasNotCalled does not take arguments'); match(TestClass.normalFunction).wasNotCalled("unwanted argument");
}).toThrow('wasNotCalled does not take arguments');
}); });
it('should throw an exception when invoked on a non-spy', shouldThrowAnExceptionWhenInvokedOnANonSpy('wasNotCalled')); it('should throw an exception when invoked on a non-spy', shouldThrowAnExceptionWhenInvokedOnANonSpy('wasNotCalled'));
}); });
describe("wasCalledWith", function() { describe("toHaveBeenCalledWith", function() {
it('wasCalledWith should return true if it was called with the expected args', function() { it('toHaveBeenCalledWith should return true if it was called with the expected args', function() {
TestClass.spyFunction('a', 'b', 'c'); TestClass.spyFunction('a', 'b', 'c');
expect(match(TestClass.spyFunction).wasCalledWith('a', 'b', 'c')).toEqual(true); expect(match(TestClass.spyFunction).toHaveBeenCalledWith('a', 'b', 'c')).toPass();
}); });
it('should return false if it was not called with the expected args', function() { it('should return false if it was not called with the expected args', function() {
TestClass.spyFunction('a', 'b', 'c'); TestClass.spyFunction('a', 'b', 'c');
var expected = match(TestClass.spyFunction); var expected = match(TestClass.spyFunction);
expect(expected.wasCalledWith('c', 'b', 'a')).toEqual(false); expect(expected.toHaveBeenCalledWith('c', 'b', 'a')).toFail();
var result = lastResult(); var result = lastResult();
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.expected).toEqual(['c', 'b', 'a']); expect(result.expected).toEqual(['c', 'b', 'a']);
expect(result.actual.mostRecentCall.args).toEqual(['a', 'b', 'c']); expect(result.actual.mostRecentCall.args).toEqual(['a', 'b', 'c']);
expect(result.message).toContain(jasmine.pp(result.expected)); expect(result.message).toContain(jasmine.pp(result.expected));
@ -615,24 +729,40 @@ describe("jasmine.Matchers", function() {
it('should return false if it was not called', function() { it('should return false if it was not called', function() {
var expected = match(TestClass.spyFunction); var expected = match(TestClass.spyFunction);
expect(expected.wasCalledWith('c', 'b', 'a')).toEqual(false); expect(expected.toHaveBeenCalledWith('c', 'b', 'a')).toFail();
var result = lastResult(); var result = lastResult();
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.expected).toEqual(['c', 'b', 'a']); expect(result.expected).toEqual(['c', 'b', 'a']);
expect(result.actual.argsForCall).toEqual([]); expect(result.actual.argsForCall).toEqual([]);
expect(result.message).toContain(jasmine.pp(result.expected)); expect(result.message).toContain(jasmine.pp(result.expected));
}); });
it('should allow matches across multiple calls', function() { it('should allow matches across multiple calls', function() {
var expected = match(TestClass.spyFunction);
TestClass.spyFunction('a', 'b', 'c'); TestClass.spyFunction('a', 'b', 'c');
TestClass.spyFunction('d', 'e', 'f'); TestClass.spyFunction('d', 'e', 'f');
expect(expected.wasCalledWith('a', 'b', 'c')).toEqual(true); var expected = match(TestClass.spyFunction);
expect(expected.wasCalledWith('d', 'e', 'f')).toEqual(true); expect(expected.toHaveBeenCalledWith('a', 'b', 'c')).toPass();
expect(expected.wasCalledWith('x', 'y', 'z')).toEqual(false); expect(expected.toHaveBeenCalledWith('d', 'e', 'f')).toPass();
expect(expected.toHaveBeenCalledWith('x', 'y', 'z')).toFail();
}); });
it('should throw an exception when invoked on a non-spy', shouldThrowAnExceptionWhenInvokedOnANonSpy('wasCalledWith')); it("should return a decent message", function() {
TestClass.spyFunction('a', 'b', 'c');
TestClass.spyFunction('d', 'e', 'f');
var expected = match(TestClass.spyFunction);
expect(expected.toHaveBeenCalledWith('a', 'b')).toFail();
expect(lastResult().message).toEqual("Expected spy My spy to have been called with [ 'a', 'b' ] but was called with [ [ 'a', 'b', 'c' ], [ 'd', 'e', 'f' ] ]");
});
it("should return a decent message when inverted", function() {
TestClass.spyFunction('a', 'b', 'c');
TestClass.spyFunction('d', 'e', 'f');
var expected = match(TestClass.spyFunction);
expect(expected.not.toHaveBeenCalledWith('a', 'b', 'c')).toFail();
expect(lastResult().message).toEqual("Expected spy My spy not to have been called with [ 'a', 'b', 'c' ] but was called with [ [ 'a', 'b', 'c' ], [ 'd', 'e', 'f' ] ]");
});
it('should throw an exception when invoked on a non-spy', shouldThrowAnExceptionWhenInvokedOnANonSpy('toHaveBeenCalledWith'));
describe("to build an ExpectationResult", function () { describe("to build an ExpectationResult", function () {
beforeEach(function() { beforeEach(function() {
@ -649,11 +779,11 @@ describe("jasmine.Matchers", function() {
it("should should handle the case of a spy", function() { it("should should handle the case of a spy", function() {
TestClass.someFunction('a', 'c'); TestClass.someFunction('a', 'c');
var matcher = match(TestClass.someFunction); var matcher = match(TestClass.someFunction);
matcher.wasCalledWith('a', 'b'); matcher.toHaveBeenCalledWith('a', 'b');
var result = lastResult(); var result = lastResult();
expect(result.matcherName).toEqual("wasCalledWith"); expect(result.matcherName).toEqual("toHaveBeenCalledWith");
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.message).toContain(jasmine.pp(['a', 'b'])); expect(result.message).toContain(jasmine.pp(['a', 'b']));
expect(result.message).toContain(jasmine.pp(['a', 'c'])); expect(result.message).toContain(jasmine.pp(['a', 'c']));
expect(result.actual).toEqual(TestClass.someFunction); expect(result.actual).toEqual(TestClass.someFunction);
@ -662,18 +792,28 @@ describe("jasmine.Matchers", function() {
}); });
}); });
describe("wasCalledWith", function() {
it("should alias toHaveBeenCalledWith", function() {
spyOn(TestClass, 'normalFunction');
TestClass.normalFunction(123);
expect(TestClass.normalFunction).wasCalledWith(123);
});
});
describe("wasNotCalledWith", function() { describe("wasNotCalledWith", function() {
it('should return true if the spy was NOT called with the expected args', function() { it('should return true if the spy was NOT called with the expected args', function() {
TestClass.spyFunction('a', 'b', 'c'); TestClass.spyFunction('a', 'b', 'c');
expect(match(TestClass.spyFunction).wasNotCalledWith('c', 'b', 'a')).toEqual(true); expect(match(TestClass.spyFunction).wasNotCalledWith('c', 'b', 'a')).toPass();
}); });
it('should return false if it WAS called with the expected args', function() { it('should return false if it WAS called with the expected args', function() {
TestClass.spyFunction('a', 'b', 'c'); TestClass.spyFunction('a', 'b', 'c');
var expected = match(TestClass.spyFunction); var expected = match(TestClass.spyFunction);
expect(expected.wasNotCalledWith('a', 'b', 'c')).toEqual(false); expect(expected.wasNotCalledWith('a', 'b', 'c')).toFail();
var result = lastResult(); var result = lastResult();
expect(result.passed()).toEqual(false); expect(result.passed()).toFail();
expect(result.expected).toEqual(['a', 'b', 'c']); expect(result.expected).toEqual(['a', 'b', 'c']);
expect(result.actual.mostRecentCall.args).toEqual(['a', 'b', 'c']); expect(result.actual.mostRecentCall.args).toEqual(['a', 'b', 'c']);
expect(result.message).toContain(jasmine.pp(result.expected)); expect(result.message).toContain(jasmine.pp(result.expected));
@ -681,21 +821,25 @@ describe("jasmine.Matchers", function() {
it('should return true if it was not called', function() { it('should return true if it was not called', function() {
var expected = match(TestClass.spyFunction); var expected = match(TestClass.spyFunction);
expect(expected.wasNotCalledWith('c', 'b', 'a')).toEqual(true); expect(expected.wasNotCalledWith('c', 'b', 'a')).toPass();
}); });
it('should allow matches across multiple calls', function() { it('should allow matches across multiple calls', function() {
var expected = match(TestClass.spyFunction); var expected = match(TestClass.spyFunction);
TestClass.spyFunction('a', 'b', 'c'); TestClass.spyFunction('a', 'b', 'c');
TestClass.spyFunction('d', 'e', 'f'); TestClass.spyFunction('d', 'e', 'f');
expect(expected.wasNotCalledWith('a', 'b', 'c')).toEqual(false); expect(expected.wasNotCalledWith('a', 'b', 'c')).toFail();
expect(expected.wasNotCalledWith('d', 'e', 'f')).toEqual(false); expect(expected.wasNotCalledWith('d', 'e', 'f')).toFail();
expect(expected.wasNotCalledWith('x', 'y', 'z')).toEqual(true); expect(expected.wasNotCalledWith('x', 'y', 'z')).toPass();
}); });
it('should throw an exception when invoked on a non-spy', shouldThrowAnExceptionWhenInvokedOnANonSpy('wasNotCalledWith')); it('should throw an exception when invoked on a non-spy', shouldThrowAnExceptionWhenInvokedOnANonSpy('wasNotCalledWith'));
}); });
});
describe("all matchers", function() {
it("should return null, for future-proofing, since we might eventually allow matcher chaining", function() {
expect(match(true).toBe(true)).toBeUndefined();
});
}); });
}); });

View File

@ -31,4 +31,8 @@ describe("MockClock", function () {
expect(interval).toEqual(2); expect(interval).toEqual(2);
}); });
}); });
it("shouldn't complain if you call jasmine.Clock.useMock() more than once", function() {
jasmine.Clock.useMock();
});
}); });

Some files were not shown because too many files have changed in this diff Show More