evergreen 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +4 -0
- data/bin/evergreen +18 -0
- data/lib/evergreen.rb +44 -0
- data/lib/evergreen/cli.rb +23 -0
- data/lib/evergreen/evergreen.js +3 -0
- data/lib/evergreen/runner.rb +56 -0
- data/lib/evergreen/server.rb +31 -0
- data/lib/evergreen/spec.rb +60 -0
- data/lib/evergreen/version.rb +3 -0
- data/lib/evergreen/views/list.erb +6 -0
- data/lib/evergreen/views/spec.erb +37 -0
- data/lib/jasmine/MIT.LICENSE +20 -0
- data/lib/jasmine/README.markdown +489 -0
- data/lib/jasmine/Rakefile +146 -0
- data/lib/jasmine/cruise_config.rb +21 -0
- data/lib/jasmine/doc/files.html +460 -0
- data/lib/jasmine/doc/index.html +322 -0
- data/lib/jasmine/doc/symbols/_global_.html +918 -0
- data/lib/jasmine/doc/symbols/jasmine.Block.html +417 -0
- data/lib/jasmine/doc/symbols/jasmine.Clock.html +678 -0
- data/lib/jasmine/doc/symbols/jasmine.Env.html +1169 -0
- data/lib/jasmine/doc/symbols/jasmine.JsApiReporter.html +822 -0
- data/lib/jasmine/doc/symbols/jasmine.Matchers.html +1474 -0
- data/lib/jasmine/doc/symbols/jasmine.MultiReporter.html +394 -0
- data/lib/jasmine/doc/symbols/jasmine.NestedResults.html +710 -0
- data/lib/jasmine/doc/symbols/jasmine.Reporter.html +574 -0
- data/lib/jasmine/doc/symbols/jasmine.Runner.html +710 -0
- data/lib/jasmine/doc/symbols/jasmine.Spec.html +1253 -0
- data/lib/jasmine/doc/symbols/jasmine.Spy.html +855 -0
- data/lib/jasmine/doc/symbols/jasmine.Suite.html +705 -0
- data/lib/jasmine/doc/symbols/jasmine.html +1345 -0
- data/lib/jasmine/doc/symbols/jasmine.util.html +535 -0
- data/lib/jasmine/doc/symbols/src/lib_TrivialReporter.js.html +124 -0
- data/lib/jasmine/doc/symbols/src/src_Block.js.html +29 -0
- data/lib/jasmine/doc/symbols/src/src_Env.js.html +248 -0
- data/lib/jasmine/doc/symbols/src/src_JsApiReporter.js.html +111 -0
- data/lib/jasmine/doc/symbols/src/src_Matchers.js.html +344 -0
- data/lib/jasmine/doc/symbols/src/src_MultiReporter.js.html +36 -0
- data/lib/jasmine/doc/symbols/src/src_NestedResults.js.html +88 -0
- data/lib/jasmine/doc/symbols/src/src_PrettyPrinter.js.html +130 -0
- data/lib/jasmine/doc/symbols/src/src_Queue.js.html +102 -0
- data/lib/jasmine/doc/symbols/src/src_Reporter.js.html +35 -0
- data/lib/jasmine/doc/symbols/src/src_Reporters.js.html +51 -0
- data/lib/jasmine/doc/symbols/src/src_Runner.js.html +75 -0
- data/lib/jasmine/doc/symbols/src/src_Spec.js.html +214 -0
- data/lib/jasmine/doc/symbols/src/src_Suite.js.html +77 -0
- data/lib/jasmine/doc/symbols/src/src_WaitsBlock.js.html +21 -0
- data/lib/jasmine/doc/symbols/src/src_WaitsForBlock.js.html +45 -0
- data/lib/jasmine/doc/symbols/src/src_base.js.html +585 -0
- data/lib/jasmine/doc/symbols/src/src_mock-timeout.js.html +185 -0
- data/lib/jasmine/doc/symbols/src/src_util.js.html +75 -0
- data/lib/jasmine/example/example_runner.html +22 -0
- data/lib/jasmine/example/spec/example_suite.js +11 -0
- data/lib/jasmine/images/fail-16.png +0 -0
- data/lib/jasmine/images/fail.png +0 -0
- data/lib/jasmine/images/go-16.png +0 -0
- data/lib/jasmine/images/go.png +0 -0
- data/lib/jasmine/images/pending-16.png +0 -0
- data/lib/jasmine/images/pending.png +0 -0
- data/lib/jasmine/images/question-bk.png +0 -0
- data/lib/jasmine/images/questionbk-16.png +0 -0
- data/lib/jasmine/images/spinner.gif +0 -0
- data/lib/jasmine/lib/TrivialReporter.js +171 -0
- data/lib/jasmine/lib/consolex.js +28 -0
- data/lib/jasmine/lib/jasmine-0.10.4.js +2371 -0
- data/lib/jasmine/lib/jasmine.css +166 -0
- data/lib/jasmine/lib/json2.js +478 -0
- data/lib/jasmine/spec/jasmine_helper.rb +44 -0
- data/lib/jasmine/spec/jasmine_spec.rb +31 -0
- data/lib/jasmine/spec/runner.html +80 -0
- data/lib/jasmine/spec/saucelabs.yml +24 -0
- data/lib/jasmine/spec/suites/CustomMatchersSpec.js +112 -0
- data/lib/jasmine/spec/suites/EnvSpec.js +158 -0
- data/lib/jasmine/spec/suites/ExceptionsSpec.js +107 -0
- data/lib/jasmine/spec/suites/JsApiReporterSpec.js +96 -0
- data/lib/jasmine/spec/suites/MatchersSpec.js +709 -0
- data/lib/jasmine/spec/suites/MockClockSpec.js +34 -0
- data/lib/jasmine/spec/suites/MultiReporterSpec.js +30 -0
- data/lib/jasmine/spec/suites/NestedResultsSpec.js +54 -0
- data/lib/jasmine/spec/suites/PrettyPrintSpec.js +93 -0
- data/lib/jasmine/spec/suites/QueueSpec.js +23 -0
- data/lib/jasmine/spec/suites/ReporterSpec.js +60 -0
- data/lib/jasmine/spec/suites/RunnerSpec.js +267 -0
- data/lib/jasmine/spec/suites/SpecRunningSpec.js +1195 -0
- data/lib/jasmine/spec/suites/SpecSpec.js +110 -0
- data/lib/jasmine/spec/suites/SpySpec.js +201 -0
- data/lib/jasmine/spec/suites/SuiteSpec.js +120 -0
- data/lib/jasmine/spec/suites/TrivialReporterSpec.js +158 -0
- data/lib/jasmine/spec/suites/UtilSpec.js +40 -0
- data/lib/jasmine/spec/suites/WaitsForBlockSpec.js +88 -0
- data/lib/jasmine/src/Block.js +22 -0
- data/lib/jasmine/src/Env.js +263 -0
- data/lib/jasmine/src/JsApiReporter.js +104 -0
- data/lib/jasmine/src/Matchers.js +336 -0
- data/lib/jasmine/src/MultiReporter.js +28 -0
- data/lib/jasmine/src/NestedResults.js +80 -0
- data/lib/jasmine/src/PrettyPrinter.js +122 -0
- data/lib/jasmine/src/Queue.js +94 -0
- data/lib/jasmine/src/Reporter.js +27 -0
- data/lib/jasmine/src/Reporters.js +43 -0
- data/lib/jasmine/src/Runner.js +77 -0
- data/lib/jasmine/src/Spec.js +206 -0
- data/lib/jasmine/src/Suite.js +82 -0
- data/lib/jasmine/src/WaitsBlock.js +13 -0
- data/lib/jasmine/src/WaitsForBlock.js +37 -0
- data/lib/jasmine/src/base.js +586 -0
- data/lib/jasmine/src/mock-timeout.js +177 -0
- data/lib/jasmine/src/util.js +67 -0
- data/lib/jasmine/src/version.json +5 -0
- metadata +238 -0
@@ -0,0 +1,344 @@
|
|
1
|
+
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
2
|
+
.KEYW {color: #933;}
|
3
|
+
.COMM {color: #bbb; font-style: italic;}
|
4
|
+
.NUMB {color: #393;}
|
5
|
+
.STRN {color: #393;}
|
6
|
+
.REGX {color: #339;}
|
7
|
+
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
8
|
+
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
|
9
|
+
<span class='line'> 2</span> * @constructor
|
10
|
+
<span class='line'> 3</span> * @param {jasmine.Env} env
|
11
|
+
<span class='line'> 4</span> * @param actual
|
12
|
+
<span class='line'> 5</span> * @param {jasmine.Spec} spec
|
13
|
+
<span class='line'> 6</span> */</span><span class="WHIT">
|
14
|
+
<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="NAME">opt_isNot</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
15
|
+
<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">
|
16
|
+
<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">
|
17
|
+
<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">
|
18
|
+
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="NAME">this.isNot</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">opt_isNot</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">
|
19
|
+
<span class='line'> 12</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">
|
20
|
+
<span class='line'> 13</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
21
|
+
<span class='line'> 14</span>
|
22
|
+
<span class='line'> 15</span> </span><span class="COMM">// todo: @deprecated as of Jasmine 0.11, remove soon [xw]</span><span class="WHIT">
|
23
|
+
<span class='line'> 16</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">
|
24
|
+
<span class='line'> 17</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.Matchers.pp() is no longer supported, please use jasmine.pp() instead!"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
25
|
+
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
26
|
+
<span class='line'> 19</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
27
|
+
<span class='line'> 20</span>
|
28
|
+
<span class='line'> 21</span> </span><span class="COMM">/** @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. */</span><span class="WHIT">
|
29
|
+
<span class='line'> 22</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">
|
30
|
+
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="COMM">// todo: report a deprecation warning [xw]</span><span class="WHIT">
|
31
|
+
<span class='line'> 24</span>
|
32
|
+
<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">this.isNot</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
33
|
+
<span class='line'> 26</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">"As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
34
|
+
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
35
|
+
<span class='line'> 28</span> </span><span class="WHIT">
|
36
|
+
<span class='line'> 29</span> </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">
|
37
|
+
<span class='line'> 30</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">
|
38
|
+
<span class='line'> 31</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">
|
39
|
+
<span class='line'> 32</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">
|
40
|
+
<span class='line'> 33</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">
|
41
|
+
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
42
|
+
<span class='line'> 35</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">
|
43
|
+
<span class='line'> 36</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">
|
44
|
+
<span class='line'> 37</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
45
|
+
<span class='line'> 38</span>
|
46
|
+
<span class='line'> 39</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">
|
47
|
+
<span class='line'> 40</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">
|
48
|
+
<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">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">
|
49
|
+
<span class='line'> 42</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">
|
50
|
+
<span class='line'> 43</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">
|
51
|
+
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
52
|
+
<span class='line'> 45</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
53
|
+
<span class='line'> 46</span>
|
54
|
+
<span class='line'> 47</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">
|
55
|
+
<span class='line'> 48</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">
|
56
|
+
<span class='line'> 49</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">
|
57
|
+
<span class='line'> 50</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">
|
58
|
+
<span class='line'> 51</span>
|
59
|
+
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.isNot</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
60
|
+
<span class='line'> 53</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">result</span><span class="PUNC">;</span><span class="WHIT">
|
61
|
+
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
62
|
+
<span class='line'> 55</span>
|
63
|
+
<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.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">
|
64
|
+
<span class='line'> 57</span>
|
65
|
+
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">;</span><span class="WHIT">
|
66
|
+
<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="PUNC">!</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
67
|
+
<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">this.message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
68
|
+
<span class='line'> 61</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">
|
69
|
+
<span class='line'> 62</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">message</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
70
|
+
<span class='line'> 63</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">message</span><span class="PUNC">[</span><span class="NAME">this.isNot</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="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
71
|
+
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
72
|
+
<span class='line'> 65</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">
|
73
|
+
<span class='line'> 66</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">
|
74
|
+
<span class='line'> 67</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="PUNC">(</span><span class="NAME">this.isNot</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">" not "</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><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">englishyPredicate</span><span class="PUNC">;</span><span class="WHIT">
|
75
|
+
<span class='line'> 68</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">
|
76
|
+
<span class='line'> 69</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"><</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">
|
77
|
+
<span class='line'> 70</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">
|
78
|
+
<span class='line'> 71</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">
|
79
|
+
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
80
|
+
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
81
|
+
<span class='line'> 74</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">
|
82
|
+
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
83
|
+
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
84
|
+
<span class='line'> 77</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">
|
85
|
+
<span class='line'> 78</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">
|
86
|
+
<span class='line'> 79</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">
|
87
|
+
<span class='line'> 80</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">
|
88
|
+
<span class='line'> 81</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">
|
89
|
+
<span class='line'> 82</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">
|
90
|
+
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
91
|
+
<span class='line'> 84</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">
|
92
|
+
<span class='line'> 85</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">
|
93
|
+
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
94
|
+
<span class='line'> 87</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
95
|
+
<span class='line'> 88</span>
|
96
|
+
<span class='line'> 89</span>
|
97
|
+
<span class='line'> 90</span>
|
98
|
+
<span class='line'> 91</span>
|
99
|
+
<span class='line'> 92</span> </span><span class="COMM">/**
|
100
|
+
<span class='line'> 93</span> * toBe: compares the actual to the expected using ===
|
101
|
+
<span class='line'> 94</span> * @param expected
|
102
|
+
<span class='line'> 95</span> */</span><span class="WHIT">
|
103
|
+
<span class='line'> 96</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">
|
104
|
+
<span class='line'> 97</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">
|
105
|
+
<span class='line'> 98</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
106
|
+
<span class='line'> 99</span>
|
107
|
+
<span class='line'>100</span> </span><span class="COMM">/**
|
108
|
+
<span class='line'>101</span> * toNotBe: compares the actual to the expected using !==
|
109
|
+
<span class='line'>102</span> * @param expected
|
110
|
+
<span class='line'>103</span> */</span><span class="WHIT">
|
111
|
+
<span class='line'>104</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">
|
112
|
+
<span class='line'>105</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">
|
113
|
+
<span class='line'>106</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
114
|
+
<span class='line'>107</span>
|
115
|
+
<span class='line'>108</span> </span><span class="COMM">/**
|
116
|
+
<span class='line'>109</span> * toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc.
|
117
|
+
<span class='line'>110</span> *
|
118
|
+
<span class='line'>111</span> * @param expected
|
119
|
+
<span class='line'>112</span> */</span><span class="WHIT">
|
120
|
+
<span class='line'>113</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">
|
121
|
+
<span class='line'>114</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">
|
122
|
+
<span class='line'>115</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
123
|
+
<span class='line'>116</span>
|
124
|
+
<span class='line'>117</span> </span><span class="COMM">/**
|
125
|
+
<span class='line'>118</span> * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual
|
126
|
+
<span class='line'>119</span> * @param expected
|
127
|
+
<span class='line'>120</span> */</span><span class="WHIT">
|
128
|
+
<span class='line'>121</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">
|
129
|
+
<span class='line'>122</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">
|
130
|
+
<span class='line'>123</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
131
|
+
<span class='line'>124</span>
|
132
|
+
<span class='line'>125</span> </span><span class="COMM">/**
|
133
|
+
<span class='line'>126</span> * Matcher that compares the actual to the expected using a regular expression. Constructs a RegExp, so takes
|
134
|
+
<span class='line'>127</span> * a pattern or a String.
|
135
|
+
<span class='line'>128</span> *
|
136
|
+
<span class='line'>129</span> * @param expected
|
137
|
+
<span class='line'>130</span> */</span><span class="WHIT">
|
138
|
+
<span class='line'>131</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">
|
139
|
+
<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">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">
|
140
|
+
<span class='line'>133</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
141
|
+
<span class='line'>134</span>
|
142
|
+
<span class='line'>135</span> </span><span class="COMM">/**
|
143
|
+
<span class='line'>136</span> * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch
|
144
|
+
<span class='line'>137</span> * @param expected
|
145
|
+
<span class='line'>138</span> */</span><span class="WHIT">
|
146
|
+
<span class='line'>139</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">
|
147
|
+
<span class='line'>140</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">
|
148
|
+
<span class='line'>141</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
149
|
+
<span class='line'>142</span>
|
150
|
+
<span class='line'>143</span> </span><span class="COMM">/**
|
151
|
+
<span class='line'>144</span> * Matcher that compares the actual to jasmine.undefined.
|
152
|
+
<span class='line'>145</span> */</span><span class="WHIT">
|
153
|
+
<span class='line'>146</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">
|
154
|
+
<span class='line'>147</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">
|
155
|
+
<span class='line'>148</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
156
|
+
<span class='line'>149</span>
|
157
|
+
<span class='line'>150</span> </span><span class="COMM">/**
|
158
|
+
<span class='line'>151</span> * Matcher that compares the actual to jasmine.undefined.
|
159
|
+
<span class='line'>152</span> */</span><span class="WHIT">
|
160
|
+
<span class='line'>153</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">
|
161
|
+
<span class='line'>154</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">
|
162
|
+
<span class='line'>155</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
163
|
+
<span class='line'>156</span>
|
164
|
+
<span class='line'>157</span> </span><span class="COMM">/**
|
165
|
+
<span class='line'>158</span> * Matcher that compares the actual to null.
|
166
|
+
<span class='line'>159</span> */</span><span class="WHIT">
|
167
|
+
<span class='line'>160</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">
|
168
|
+
<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="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">
|
169
|
+
<span class='line'>162</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
170
|
+
<span class='line'>163</span>
|
171
|
+
<span class='line'>164</span> </span><span class="COMM">/**
|
172
|
+
<span class='line'>165</span> * Matcher that boolean not-nots the actual.
|
173
|
+
<span class='line'>166</span> */</span><span class="WHIT">
|
174
|
+
<span class='line'>167</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">
|
175
|
+
<span class='line'>168</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">
|
176
|
+
<span class='line'>169</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
177
|
+
<span class='line'>170</span>
|
178
|
+
<span class='line'>171</span>
|
179
|
+
<span class='line'>172</span> </span><span class="COMM">/**
|
180
|
+
<span class='line'>173</span> * Matcher that boolean nots the actual.
|
181
|
+
<span class='line'>174</span> */</span><span class="WHIT">
|
182
|
+
<span class='line'>175</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">
|
183
|
+
<span class='line'>176</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">
|
184
|
+
<span class='line'>177</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
185
|
+
<span class='line'>178</span>
|
186
|
+
<span class='line'>179</span> </span><span class="COMM">/**
|
187
|
+
<span class='line'>180</span> * Matcher that checks to see if the actual, a Jasmine spy, was called.
|
188
|
+
<span class='line'>181</span> */</span><span class="WHIT">
|
189
|
+
<span class='line'>182</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">
|
190
|
+
<span class='line'>183</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">
|
191
|
+
<span class='line'>184</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">
|
192
|
+
<span class='line'>185</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
193
|
+
<span class='line'>186</span>
|
194
|
+
<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="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">
|
195
|
+
<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">'Expected a spy, but got '</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="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
196
|
+
<span class='line'>189</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
197
|
+
<span class='line'>190</span>
|
198
|
+
<span class='line'>191</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">
|
199
|
+
<span class='line'>192</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">
|
200
|
+
<span class='line'>193</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
201
|
+
<span class='line'>194</span>
|
202
|
+
<span class='line'>195</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">
|
203
|
+
<span class='line'>196</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
204
|
+
<span class='line'>197</span>
|
205
|
+
<span class='line'>198</span> </span><span class="COMM">/**
|
206
|
+
<span class='line'>199</span> * Matcher that checks to see if the actual, a Jasmine spy, was not called.
|
207
|
+
<span class='line'>200</span> */</span><span class="WHIT">
|
208
|
+
<span class='line'>201</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">
|
209
|
+
<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">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">
|
210
|
+
<span class='line'>203</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">
|
211
|
+
<span class='line'>204</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
212
|
+
<span class='line'>205</span>
|
213
|
+
<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="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">
|
214
|
+
<span class='line'>207</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.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">
|
215
|
+
<span class='line'>208</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
216
|
+
<span class='line'>209</span>
|
217
|
+
<span class='line'>210</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">
|
218
|
+
<span class='line'>211</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">
|
219
|
+
<span class='line'>212</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
220
|
+
<span class='line'>213</span>
|
221
|
+
<span class='line'>214</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">
|
222
|
+
<span class='line'>215</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
223
|
+
<span class='line'>216</span>
|
224
|
+
<span class='line'>217</span> </span><span class="COMM">/**
|
225
|
+
<span class='line'>218</span> * Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters.
|
226
|
+
<span class='line'>219</span> *
|
227
|
+
<span class='line'>220</span> * @example
|
228
|
+
<span class='line'>221</span> *
|
229
|
+
<span class='line'>222</span> */</span><span class="WHIT">
|
230
|
+
<span class='line'>223</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">
|
231
|
+
<span class='line'>224</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">expectedArgs</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">
|
232
|
+
<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">
|
233
|
+
<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.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">
|
234
|
+
<span class='line'>227</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
235
|
+
<span class='line'>228</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">
|
236
|
+
<span class='line'>229</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">
|
237
|
+
<span class='line'>230</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">expectedArgs</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">
|
238
|
+
<span class='line'>231</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">
|
239
|
+
<span class='line'>232</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">expectedArgs</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">
|
240
|
+
<span class='line'>233</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
241
|
+
<span class='line'>234</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
242
|
+
<span class='line'>235</span>
|
243
|
+
<span class='line'>236</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">expectedArgs</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
244
|
+
<span class='line'>237</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
245
|
+
<span class='line'>238</span>
|
246
|
+
<span class='line'>239</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">
|
247
|
+
<span class='line'>240</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">expectedArgs</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">
|
248
|
+
<span class='line'>241</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">
|
249
|
+
<span class='line'>242</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.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">
|
250
|
+
<span class='line'>243</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
251
|
+
<span class='line'>244</span>
|
252
|
+
<span class='line'>245</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">
|
253
|
+
<span class='line'>246</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">expectedArgs</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">
|
254
|
+
<span class='line'>247</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
255
|
+
<span class='line'>248</span>
|
256
|
+
<span class='line'>249</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">expectedArgs</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
257
|
+
<span class='line'>250</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
258
|
+
<span class='line'>251</span>
|
259
|
+
<span class='line'>252</span> </span><span class="COMM">/**
|
260
|
+
<span class='line'>253</span> * Matcher that checks that the expected item is an element in the actual Array.
|
261
|
+
<span class='line'>254</span> *
|
262
|
+
<span class='line'>255</span> * @param {Object} expected
|
263
|
+
<span class='line'>256</span> */</span><span class="WHIT">
|
264
|
+
<span class='line'>257</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">
|
265
|
+
<span class='line'>258</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">
|
266
|
+
<span class='line'>259</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
267
|
+
<span class='line'>260</span>
|
268
|
+
<span class='line'>261</span> </span><span class="COMM">/**
|
269
|
+
<span class='line'>262</span> * Matcher that checks that the expected item is NOT an element in the actual Array.
|
270
|
+
<span class='line'>263</span> *
|
271
|
+
<span class='line'>264</span> * @param {Object} expected
|
272
|
+
<span class='line'>265</span> */</span><span class="WHIT">
|
273
|
+
<span class='line'>266</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">
|
274
|
+
<span class='line'>267</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">
|
275
|
+
<span class='line'>268</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
276
|
+
<span class='line'>269</span>
|
277
|
+
<span class='line'>270</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">
|
278
|
+
<span class='line'>271</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">
|
279
|
+
<span class='line'>272</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
280
|
+
<span class='line'>273</span>
|
281
|
+
<span class='line'>274</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">
|
282
|
+
<span class='line'>275</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">
|
283
|
+
<span class='line'>276</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
284
|
+
<span class='line'>277</span>
|
285
|
+
<span class='line'>278</span> </span><span class="COMM">/**
|
286
|
+
<span class='line'>279</span> * Matcher that checks that the expected exception was thrown by the actual.
|
287
|
+
<span class='line'>280</span> *
|
288
|
+
<span class='line'>281</span> * @param {String} expected
|
289
|
+
<span class='line'>282</span> */</span><span class="WHIT">
|
290
|
+
<span class='line'>283</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">
|
291
|
+
<span class='line'>284</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">
|
292
|
+
<span class='line'>285</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">
|
293
|
+
<span class='line'>286</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">
|
294
|
+
<span class='line'>287</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">
|
295
|
+
<span class='line'>288</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
296
|
+
<span class='line'>289</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
297
|
+
<span class='line'>290</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">
|
298
|
+
<span class='line'>291</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">
|
299
|
+
<span class='line'>292</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">
|
300
|
+
<span class='line'>293</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
301
|
+
<span class='line'>294</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">
|
302
|
+
<span class='line'>295</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">
|
303
|
+
<span class='line'>296</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
304
|
+
<span class='line'>297</span>
|
305
|
+
<span class='line'>298</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">
|
306
|
+
<span class='line'>299</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">
|
307
|
+
<span class='line'>300</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">
|
308
|
+
<span class='line'>301</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">
|
309
|
+
<span class='line'>302</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">
|
310
|
+
<span class='line'>303</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
311
|
+
<span class='line'>304</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
312
|
+
<span class='line'>305</span>
|
313
|
+
<span class='line'>306</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">
|
314
|
+
<span class='line'>307</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
315
|
+
<span class='line'>308</span>
|
316
|
+
<span class='line'>309</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">
|
317
|
+
<span class='line'>310</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">
|
318
|
+
<span class='line'>311</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
319
|
+
<span class='line'>312</span>
|
320
|
+
<span class='line'>313</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">
|
321
|
+
<span class='line'>314</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">
|
322
|
+
<span class='line'>315</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">
|
323
|
+
<span class='line'>316</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
324
|
+
<span class='line'>317</span>
|
325
|
+
<span class='line'>318</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">
|
326
|
+
<span class='line'>319</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">
|
327
|
+
<span class='line'>320</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
328
|
+
<span class='line'>321</span>
|
329
|
+
<span class='line'>322</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">
|
330
|
+
<span class='line'>323</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">
|
331
|
+
<span class='line'>324</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
332
|
+
<span class='line'>325</span>
|
333
|
+
<span class='line'>326</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">
|
334
|
+
<span class='line'>327</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">
|
335
|
+
<span class='line'>328</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
336
|
+
<span class='line'>329</span>
|
337
|
+
<span class='line'>330</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">
|
338
|
+
<span class='line'>331</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
339
|
+
<span class='line'>332</span>
|
340
|
+
<span class='line'>333</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">
|
341
|
+
<span class='line'>334</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'<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">
|
342
|
+
<span class='line'>335</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
343
|
+
<span class='line'>336</span>
|
344
|
+
<span class='line'>337</span> </span></pre></body></html>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
2
|
+
.KEYW {color: #933;}
|
3
|
+
.COMM {color: #bbb; font-style: italic;}
|
4
|
+
.NUMB {color: #393;}
|
5
|
+
.STRN {color: #393;}
|
6
|
+
.REGX {color: #339;}
|
7
|
+
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
8
|
+
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
|
9
|
+
<span class='line'> 2</span> * @constructor
|
10
|
+
<span class='line'> 3</span> */</span><span class="WHIT">
|
11
|
+
<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">
|
12
|
+
<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">
|
13
|
+
<span class='line'> 6</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
14
|
+
<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">
|
15
|
+
<span class='line'> 8</span>
|
16
|
+
<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">
|
17
|
+
<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">
|
18
|
+
<span class='line'> 11</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
19
|
+
<span class='line'> 12</span>
|
20
|
+
<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">
|
21
|
+
<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">
|
22
|
+
<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"><</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">
|
23
|
+
<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">
|
24
|
+
<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">
|
25
|
+
<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">
|
26
|
+
<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"><</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">
|
27
|
+
<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">
|
28
|
+
<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">
|
29
|
+
<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">
|
30
|
+
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
31
|
+
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
32
|
+
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
33
|
+
<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">
|
34
|
+
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
35
|
+
<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">
|
36
|
+
<span class='line'> 29</span> </span></pre></body></html>
|
@@ -0,0 +1,88 @@
|
|
1
|
+
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
2
|
+
.KEYW {color: #933;}
|
3
|
+
.COMM {color: #bbb; font-style: italic;}
|
4
|
+
.NUMB {color: #393;}
|
5
|
+
.STRN {color: #393;}
|
6
|
+
.REGX {color: #339;}
|
7
|
+
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
8
|
+
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
|
9
|
+
<span class='line'> 2</span> * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults
|
10
|
+
<span class='line'> 3</span> *
|
11
|
+
<span class='line'> 4</span> * @constructor
|
12
|
+
<span class='line'> 5</span> */</span><span class="WHIT">
|
13
|
+
<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">
|
14
|
+
<span class='line'> 7</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
15
|
+
<span class='line'> 8</span> * The total count of results
|
16
|
+
<span class='line'> 9</span> */</span><span class="WHIT">
|
17
|
+
<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">
|
18
|
+
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
19
|
+
<span class='line'> 12</span> * Number of passed results
|
20
|
+
<span class='line'> 13</span> */</span><span class="WHIT">
|
21
|
+
<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">
|
22
|
+
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
23
|
+
<span class='line'> 16</span> * Number of failed results
|
24
|
+
<span class='line'> 17</span> */</span><span class="WHIT">
|
25
|
+
<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">
|
26
|
+
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
27
|
+
<span class='line'> 20</span> * Was this suite/spec skipped?
|
28
|
+
<span class='line'> 21</span> */</span><span class="WHIT">
|
29
|
+
<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">
|
30
|
+
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
31
|
+
<span class='line'> 24</span> * @ignore
|
32
|
+
<span class='line'> 25</span> */</span><span class="WHIT">
|
33
|
+
<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">
|
34
|
+
<span class='line'> 27</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
35
|
+
<span class='line'> 28</span>
|
36
|
+
<span class='line'> 29</span> </span><span class="COMM">/**
|
37
|
+
<span class='line'> 30</span> * Roll up the result counts.
|
38
|
+
<span class='line'> 31</span> *
|
39
|
+
<span class='line'> 32</span> * @param result
|
40
|
+
<span class='line'> 33</span> */</span><span class="WHIT">
|
41
|
+
<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">
|
42
|
+
<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">
|
43
|
+
<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">
|
44
|
+
<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">
|
45
|
+
<span class='line'> 38</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
46
|
+
<span class='line'> 39</span>
|
47
|
+
<span class='line'> 40</span> </span><span class="COMM">/**
|
48
|
+
<span class='line'> 41</span> * Tracks a result's message.
|
49
|
+
<span class='line'> 42</span> * @param message
|
50
|
+
<span class='line'> 43</span> */</span><span class="WHIT">
|
51
|
+
<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">
|
52
|
+
<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">
|
53
|
+
<span class='line'> 46</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
54
|
+
<span class='line'> 47</span>
|
55
|
+
<span class='line'> 48</span> </span><span class="COMM">/**
|
56
|
+
<span class='line'> 49</span> * Getter for the results: message & results.
|
57
|
+
<span class='line'> 50</span> */</span><span class="WHIT">
|
58
|
+
<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">
|
59
|
+
<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">
|
60
|
+
<span class='line'> 53</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
61
|
+
<span class='line'> 54</span>
|
62
|
+
<span class='line'> 55</span> </span><span class="COMM">/**
|
63
|
+
<span class='line'> 56</span> * Adds a result, tracking counts (total, passed, & failed)
|
64
|
+
<span class='line'> 57</span> * @param {jasmine.ExpectationResult|jasmine.NestedResults} result
|
65
|
+
<span class='line'> 58</span> */</span><span class="WHIT">
|
66
|
+
<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">
|
67
|
+
<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">
|
68
|
+
<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">
|
69
|
+
<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">
|
70
|
+
<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">
|
71
|
+
<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">
|
72
|
+
<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">
|
73
|
+
<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">
|
74
|
+
<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">
|
75
|
+
<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">
|
76
|
+
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
77
|
+
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
78
|
+
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
79
|
+
<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">
|
80
|
+
<span class='line'> 73</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
81
|
+
<span class='line'> 74</span>
|
82
|
+
<span class='line'> 75</span> </span><span class="COMM">/**
|
83
|
+
<span class='line'> 76</span> * @returns {Boolean} True if <b>everything</b> below passed
|
84
|
+
<span class='line'> 77</span> */</span><span class="WHIT">
|
85
|
+
<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">
|
86
|
+
<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">
|
87
|
+
<span class='line'> 80</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
88
|
+
<span class='line'> 81</span> </span></pre></body></html>
|