evergreen 1.0.0.rc → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/README.rdoc +10 -2
  2. data/config/routes.rb +1 -1
  3. data/lib/evergreen.rb +2 -6
  4. data/lib/evergreen/application.rb +38 -59
  5. data/lib/evergreen/cli.rb +2 -2
  6. data/lib/evergreen/runner.rb +6 -3
  7. data/lib/evergreen/server.rb +1 -5
  8. data/lib/evergreen/suite.rb +1 -13
  9. data/lib/evergreen/tasks.rb +1 -1
  10. data/lib/evergreen/version.rb +1 -1
  11. data/lib/jasmine/Contribute.markdown +44 -0
  12. data/lib/jasmine/Gemfile +4 -6
  13. data/lib/jasmine/MIT.LICENSE +1 -1
  14. data/lib/jasmine/README.markdown +17 -14
  15. data/lib/jasmine/Rakefile +21 -170
  16. data/lib/jasmine/Release.markdown +40 -0
  17. data/lib/jasmine/images/jasmine_favicon.png +0 -0
  18. data/lib/jasmine/jasmine-core.gemspec +22 -0
  19. data/lib/jasmine/jshint/jshint.js +5919 -0
  20. data/lib/jasmine/jshint/run.js +99 -0
  21. data/lib/jasmine/lib/jasmine-core.rb +36 -0
  22. data/lib/jasmine/lib/jasmine-core/example/SpecRunner.html +54 -0
  23. data/lib/jasmine/{example → lib/jasmine-core/example}/spec/PlayerSpec.js +0 -0
  24. data/lib/jasmine/{example → lib/jasmine-core/example}/spec/SpecHelper.js +3 -3
  25. data/lib/jasmine/{example → lib/jasmine-core/example}/src/Player.js +0 -0
  26. data/lib/jasmine/{example → lib/jasmine-core/example}/src/Song.js +0 -0
  27. data/lib/jasmine/lib/{jasmine-html.js → jasmine-core/jasmine-html.js} +6 -4
  28. data/lib/jasmine/lib/{jasmine.css → jasmine-core/jasmine.css} +0 -0
  29. data/lib/jasmine/lib/{jasmine.js → jasmine-core/jasmine.js} +103 -48
  30. data/lib/jasmine/lib/{json2.js → jasmine-core/json2.js} +0 -0
  31. data/lib/jasmine/lib/jasmine-core/version.rb +6 -0
  32. data/lib/jasmine/spec/console/ConsoleReporterSpec.js +451 -0
  33. data/lib/jasmine/spec/{suites → core}/BaseSpec.js +0 -0
  34. data/lib/jasmine/spec/{suites → core}/CustomMatchersSpec.js +0 -0
  35. data/lib/jasmine/spec/{suites → core}/EnvSpec.js +3 -2
  36. data/lib/jasmine/spec/{suites → core}/ExceptionsSpec.js +46 -4
  37. data/lib/jasmine/spec/{suites → core}/JsApiReporterSpec.js +1 -1
  38. data/lib/jasmine/spec/{suites → core}/MatchersSpec.js +87 -44
  39. data/lib/jasmine/spec/{suites → core}/MockClockSpec.js +0 -0
  40. data/lib/jasmine/spec/{suites → core}/MultiReporterSpec.js +3 -3
  41. data/lib/jasmine/spec/{suites → core}/NestedResultsSpec.js +0 -0
  42. data/lib/jasmine/spec/{suites → core}/PrettyPrintSpec.js +0 -6
  43. data/lib/jasmine/spec/{suites → core}/QueueSpec.js +0 -0
  44. data/lib/jasmine/spec/{suites → core}/ReporterSpec.js +0 -0
  45. data/lib/jasmine/spec/{suites → core}/RunnerSpec.js +0 -0
  46. data/lib/jasmine/spec/{suites → core}/SpecRunningSpec.js +14 -9
  47. data/lib/jasmine/spec/{suites → core}/SpecSpec.js +1 -1
  48. data/lib/jasmine/spec/{suites → core}/SpySpec.js +0 -0
  49. data/lib/jasmine/spec/{suites → core}/SuiteSpec.js +0 -0
  50. data/lib/jasmine/spec/{suites → core}/UtilSpec.js +0 -1
  51. data/lib/jasmine/spec/{suites → core}/WaitsForBlockSpec.js +32 -1
  52. data/lib/jasmine/spec/html/MatchersHtmlSpec.js +38 -0
  53. data/lib/jasmine/spec/html/PrettyPrintHtmlSpec.js +8 -0
  54. data/lib/jasmine/spec/{suites → html}/TrivialReporterSpec.js +3 -2
  55. data/lib/jasmine/spec/node_suite.js +127 -0
  56. data/lib/jasmine/spec/runner.html +44 -45
  57. data/lib/jasmine/spec/templates/runner.html.erb +49 -0
  58. data/lib/jasmine/spec/templates/script_tag.html.erb +1 -0
  59. data/lib/jasmine/src/SourcesList.json +7 -0
  60. data/lib/jasmine/src/console/ConsoleReporter.js +177 -0
  61. data/lib/jasmine/src/{Block.js → core/Block.js} +1 -1
  62. data/lib/jasmine/src/{Env.js → core/Env.js} +13 -8
  63. data/lib/jasmine/src/{JsApiReporter.js → core/JsApiReporter.js} +0 -0
  64. data/lib/jasmine/src/{Matchers.js → core/Matchers.js} +24 -7
  65. data/lib/jasmine/src/{MultiReporter.js → core/MultiReporter.js} +0 -0
  66. data/lib/jasmine/src/{NestedResults.js → core/NestedResults.js} +0 -0
  67. data/lib/jasmine/src/{PrettyPrinter.js → core/PrettyPrinter.js} +2 -1
  68. data/lib/jasmine/src/{Queue.js → core/Queue.js} +0 -0
  69. data/lib/jasmine/src/{Reporter.js → core/Reporter.js} +0 -0
  70. data/lib/jasmine/src/{Runner.js → core/Runner.js} +1 -1
  71. data/lib/jasmine/src/{Spec.js → core/Spec.js} +2 -1
  72. data/lib/jasmine/src/{Suite.js → core/Suite.js} +1 -1
  73. data/lib/jasmine/src/{WaitsBlock.js → core/WaitsBlock.js} +3 -1
  74. data/lib/jasmine/src/{WaitsForBlock.js → core/WaitsForBlock.js} +4 -2
  75. data/lib/jasmine/src/{base.js → core/base.js} +52 -24
  76. data/lib/jasmine/src/{mock-timeout.js → core/mock-timeout.js} +0 -0
  77. data/lib/jasmine/src/{util.js → core/util.js} +1 -1
  78. data/lib/jasmine/src/html/TrivialReporter.js +6 -4
  79. data/lib/jasmine/src/templates/example_project_jasmine_tags.html.erb +3 -0
  80. data/lib/jasmine/src/templates/version.js.erb +6 -0
  81. data/lib/jasmine/src/templates/version.rb.erb +6 -0
  82. data/lib/jasmine/src/version.js +6 -0
  83. data/lib/jasmine/src/version.json +2 -2
  84. data/lib/jasmine/tasks/build_dist.rb +48 -0
  85. data/lib/jasmine/tasks/build_specs.rb +50 -0
  86. data/lib/jasmine/tasks/docs.rb +17 -0
  87. data/lib/jasmine/tasks/helpers.rb +50 -0
  88. data/lib/jasmine/tasks/pages.rb +13 -0
  89. data/lib/jasmine/tasks/spec.rb +37 -0
  90. data/lib/jasmine/tasks/standalone.rb +91 -0
  91. data/lib/jasmine/tasks/version.rb +5 -0
  92. data/lib/tasks/evergreen.rake +1 -1
  93. data/spec/evergreen_spec.rb +6 -7
  94. data/spec/runner_spec.rb +1 -1
  95. data/spec/spec_helper.rb +5 -8
  96. metadata +95 -77
  97. data/lib/jasmine/cruise_config.rb +0 -21
  98. data/lib/jasmine/example/SpecRunner.html +0 -27
  99. data/lib/jasmine/images/fail-16.png +0 -0
  100. data/lib/jasmine/images/fail.png +0 -0
  101. data/lib/jasmine/images/go-16.png +0 -0
  102. data/lib/jasmine/images/go.png +0 -0
  103. data/lib/jasmine/images/pending-16.png +0 -0
  104. data/lib/jasmine/images/pending.png +0 -0
  105. data/lib/jasmine/images/question-bk.png +0 -0
  106. data/lib/jasmine/images/questionbk-16.png +0 -0
  107. data/lib/jasmine/images/spinner.gif +0 -0
@@ -64,9 +64,10 @@ describe("jasmine.Env", function() {
64
64
  "major": 1,
65
65
  "minor": 9,
66
66
  "build": 7,
67
+ "release_candidate": "1",
67
68
  "revision": 8
68
69
  };
69
- expect(env.versionString()).toEqual("1.9.7 revision 8");
70
+ expect(env.versionString()).toEqual("1.9.7.rc1 revision 8");
70
71
  });
71
72
 
72
73
  it("should return a nice string when version is unknown", function() {
@@ -108,7 +109,7 @@ describe("jasmine.Env", function() {
108
109
 
109
110
  it("should give custom equality testers precedence", function() {
110
111
  expect(env.equals_('abc', 'abc')).toBeFalsy();
111
- var o = new Object();
112
+ var o = {};
112
113
  expect(env.equals_(o, o)).toBeFalsy();
113
114
  });
114
115
  });
@@ -3,7 +3,7 @@ describe('Exceptions:', function() {
3
3
 
4
4
  beforeEach(function() {
5
5
  env = new jasmine.Env();
6
- env.updateInterval = 0;
6
+ env.updateInterval = 0;
7
7
  });
8
8
 
9
9
  it('jasmine.formatException formats Firefox exception messages as expected', function() {
@@ -89,9 +89,9 @@ describe('Exceptions:', function() {
89
89
  expect(blockResults[0].message).toMatch(/fake error 1/);
90
90
 
91
91
  expect(specResults[1].passed()).toEqual(false);
92
- var blockResults = specResults[1].getItems();
92
+ blockResults = specResults[1].getItems();
93
93
  expect(blockResults[0].passed()).toEqual(false);
94
- expect(blockResults[0].message).toMatch(/fake error 2/),
94
+ expect(blockResults[0].message).toMatch(/fake error 2/);
95
95
  expect(blockResults[1].passed()).toEqual(true);
96
96
 
97
97
  expect(specResults[2].passed()).toEqual(true);
@@ -101,7 +101,49 @@ describe('Exceptions:', function() {
101
101
  expect(blockResults[0].message).toMatch(/fake error 3/);
102
102
 
103
103
  expect(specResults[4].passed()).toEqual(true);
104
-
105
104
  });
106
105
 
106
+
107
+ it("should handle exceptions thrown directly in top-level describe blocks and continue", function () {
108
+ var suite = env.describe("a top level describe block that throws an exception", function () {
109
+ env.it("is a test that should pass", function () {
110
+ this.expect(true).toEqual(true);
111
+ });
112
+
113
+ throw new Error("top level error");
114
+ });
115
+
116
+ suite.execute();
117
+ var suiteResults = suite.results();
118
+ var specResults = suiteResults.getItems();
119
+
120
+ expect(suiteResults.passed()).toEqual(false);
121
+ expect(specResults.length).toEqual(2);
122
+
123
+ expect(specResults[1].description).toMatch(/encountered a declaration exception/);
124
+ });
125
+
126
+ it("should handle exceptions thrown directly in nested describe blocks and continue", function () {
127
+ var suite = env.describe("a top level describe", function () {
128
+ env.describe("a mid-level describe that throws an exception", function () {
129
+ env.it("is a test that should pass", function () {
130
+ this.expect(true).toEqual(true);
131
+ });
132
+
133
+ throw new Error("a mid-level error");
134
+ });
135
+ });
136
+
137
+ suite.execute();
138
+ var suiteResults = suite.results();
139
+ var specResults = suiteResults.getItems();
140
+
141
+ expect(suiteResults.passed()).toEqual(false);
142
+ expect(specResults.length).toEqual(1);
143
+
144
+ var nestedSpecResults = specResults[0].getItems();
145
+
146
+ expect(nestedSpecResults.length).toEqual(2);
147
+ expect(nestedSpecResults[1].description).toMatch(/encountered a declaration exception/);
148
+ });
107
149
  });
@@ -21,7 +21,7 @@ describe('jasmine.jsApiReporter', function() {
21
21
  nestedSuite = env.describe("nested suite", function() {
22
22
  nestedSpec = env.it("nested spec", function() {
23
23
  expect(true).toEqual(true);
24
- })
24
+ });
25
25
  });
26
26
 
27
27
  spec3 = env.it("spec 3", function() {
@@ -18,7 +18,7 @@ describe("jasmine.Matchers", function() {
18
18
  toFail: function() {
19
19
  return !lastResult().passed();
20
20
  }
21
- })
21
+ });
22
22
  });
23
23
 
24
24
  function match(value) {
@@ -68,20 +68,13 @@ describe("jasmine.Matchers", function() {
68
68
  expect((match(['a', 'b']).toEqual(['a', jasmine.undefined]))).toFail();
69
69
  expect((match(['a', 'b']).toEqual(['a', 'b', jasmine.undefined]))).toFail();
70
70
 
71
- expect((match(new String("cat")).toEqual("cat"))).toPass();
72
- expect((match(new String("cat")).toNotEqual("cat"))).toFail();
73
-
74
- expect((match(new Number(5)).toEqual(5))).toPass();
75
- expect((match(new Number('5')).toEqual(5))).toPass();
76
- expect((match(new Number(5)).toNotEqual(5))).toFail();
77
- expect((match(new Number('5')).toNotEqual(5))).toFail();
78
- });
71
+ expect((match("cat").toEqual("cat"))).toPass();
72
+ expect((match("cat").toNotEqual("cat"))).toFail();
79
73
 
80
- it("toEqual with DOM nodes", function() {
81
- var nodeA = document.createElement('div');
82
- var nodeB = document.createElement('div');
83
- expect((match(nodeA).toEqual(nodeA))).toPass();
84
- expect((match(nodeA).toEqual(nodeB))).toFail();
74
+ expect((match(5).toEqual(5))).toPass();
75
+ expect((match(parseInt('5', 10)).toEqual(5))).toPass();
76
+ expect((match(5).toNotEqual(5))).toFail();
77
+ expect((match(parseInt('5', 10)).toNotEqual(5))).toFail();
85
78
  });
86
79
 
87
80
  it("toEqual to build an Expectation Result", function() {
@@ -348,11 +341,13 @@ describe("jasmine.Matchers", function() {
348
341
  expect(match("foo").toEqual(jasmine.any(Object))).toFail();
349
342
  expect(match({someObj:'foo'}).toEqual(jasmine.any(Object))).toPass();
350
343
  expect(match({someObj:'foo'}).toEqual(jasmine.any(Function))).toFail();
351
- expect(match(function() {
352
- }).toEqual(jasmine.any(Object))).toFail();
344
+ expect(match(
345
+ function() {
346
+ }).toEqual(jasmine.any(Object))).toFail();
353
347
  expect(match(["foo", "goo"]).toEqual(["foo", jasmine.any(String)])).toPass();
354
- expect(match(function() {
355
- }).toEqual(jasmine.any(Function))).toPass();
348
+ expect(match(
349
+ function() {
350
+ }).toEqual(jasmine.any(Function))).toPass();
356
351
  expect(match(["a", function() {
357
352
  }]).toEqual(["a", jasmine.any(Function)])).toPass();
358
353
  });
@@ -471,6 +466,47 @@ describe("jasmine.Matchers", function() {
471
466
  expect(result.expected).toEqual(expected);
472
467
  });
473
468
 
469
+ describe("toBeCloseTo", function() {
470
+ it("returns 'true' iff actual and expected are equal within 2 decimal points of precision", function() {
471
+ expect(0).toBeCloseTo(0);
472
+ expect(1).toBeCloseTo(1);
473
+ expect(1).not.toBeCloseTo(1.1);
474
+ expect(1).not.toBeCloseTo(1.01);
475
+ expect(1).toBeCloseTo(1.001);
476
+
477
+ expect(1.23).toBeCloseTo(1.234);
478
+ expect(1.23).toBeCloseTo(1.233);
479
+ expect(1.23).toBeCloseTo(1.232);
480
+ expect(1.23).not.toBeCloseTo(1.24);
481
+
482
+ expect(-1.23).toBeCloseTo(-1.234);
483
+ expect(-1.23).not.toBeCloseTo(-1.24);
484
+ });
485
+
486
+ it("accepts an optional precision argument", function() {
487
+ expect(1).toBeCloseTo(1.1, 0);
488
+ expect(1.2).toBeCloseTo(1.23, 1);
489
+
490
+ expect(1.234).toBeCloseTo(1.2343, 3);
491
+ expect(1.234).not.toBeCloseTo(1.233, 3);
492
+ });
493
+
494
+ it("rounds", function() {
495
+ expect(1.23).toBeCloseTo(1.229);
496
+ expect(1.23).toBeCloseTo(1.226);
497
+ expect(1.23).toBeCloseTo(1.225);
498
+ expect(1.23).not.toBeCloseTo(1.2249999);
499
+
500
+ expect(1.23).toBeCloseTo(1.234);
501
+ expect(1.23).toBeCloseTo(1.2349999);
502
+ expect(1.23).not.toBeCloseTo(1.235);
503
+
504
+ expect(-1.23).toBeCloseTo(-1.234);
505
+ expect(-1.23).not.toBeCloseTo(-1.235);
506
+ expect(-1.23).not.toBeCloseTo(-1.236);
507
+ });
508
+ });
509
+
474
510
  describe("toThrow", function() {
475
511
  describe("when code block throws an exception", function() {
476
512
  var throwingFn;
@@ -500,7 +536,7 @@ describe("jasmine.Matchers", function() {
500
536
  describe("and matcher is inverted with .not", function() {
501
537
  it("should match any exception", function() {
502
538
  expect(match(throwingFn).not.toThrow()).toFail();
503
- expect(lastResult().message).toMatch(/Expected function not to throw an exception/);
539
+ expect(lastResult().message).toMatch(/Expected function not to throw an exception/);
504
540
  });
505
541
 
506
542
  it("should match exceptions specified by message", function() {
@@ -540,8 +576,9 @@ describe("jasmine.Matchers", function() {
540
576
 
541
577
  describe("when code block does not throw an exception", function() {
542
578
  it("should fail (or pass when inverted with .not)", function() {
543
- expect(match(function() {
544
- }).toThrow()).toFail();
579
+ expect(match(
580
+ function() {
581
+ }).toThrow()).toFail();
545
582
  expect(lastResult().message).toEqual('Expected function to throw an exception.');
546
583
  });
547
584
  });
@@ -596,21 +633,25 @@ describe("jasmine.Matchers", function() {
596
633
 
597
634
  function shouldThrowAnExceptionWhenInvokedOnANonSpy(methodName) {
598
635
  return function() {
599
- expect(function() {
600
- match(TestClass.normalFunction)[methodName]();
601
- }).toThrow('Expected a spy, but got Function.');
602
-
603
- expect(function() {
604
- match(jasmine.undefined)[methodName]();
605
- }).toThrow('Expected a spy, but got undefined.');
606
-
607
- expect(function() {
608
- match({some:'object'})[methodName]();
609
- }).toThrow('Expected a spy, but got { some : \'object\' }.');
610
-
611
- expect(function() {
612
- match("<b>")[methodName]();
613
- }).toThrow('Expected a spy, but got \'<b>\'.');
636
+ expect(
637
+ function() {
638
+ match(TestClass.normalFunction)[methodName]();
639
+ }).toThrow('Expected a spy, but got Function.');
640
+
641
+ expect(
642
+ function() {
643
+ match(jasmine.undefined)[methodName]();
644
+ }).toThrow('Expected a spy, but got undefined.');
645
+
646
+ expect(
647
+ function() {
648
+ match({some:'object'})[methodName]();
649
+ }).toThrow('Expected a spy, but got { some : \'object\' }.');
650
+
651
+ expect(
652
+ function() {
653
+ match("<b>")[methodName]();
654
+ }).toThrow('Expected a spy, but got \'<b>\'.');
614
655
  };
615
656
  }
616
657
 
@@ -623,9 +664,10 @@ describe("jasmine.Matchers", function() {
623
664
  });
624
665
 
625
666
  it("should throw an exception when invoked with any arguments", function() {
626
- expect(function() {
627
- match(TestClass.normalFunction).toHaveBeenCalled("unwanted argument");
628
- }).toThrow('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith');
667
+ expect(
668
+ function() {
669
+ match(TestClass.normalFunction).toHaveBeenCalled("unwanted argument");
670
+ }).toThrow('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith');
629
671
  });
630
672
 
631
673
  it('should throw an exception when invoked on a non-spy', shouldThrowAnExceptionWhenInvokedOnANonSpy('toHaveBeenCalled'));
@@ -651,9 +693,10 @@ describe("jasmine.Matchers", function() {
651
693
  });
652
694
 
653
695
  it("should throw an exception when invoked with any arguments", function() {
654
- expect(function() {
655
- match(TestClass.normalFunction).wasNotCalled("unwanted argument");
656
- }).toThrow('wasNotCalled does not take arguments');
696
+ expect(
697
+ function() {
698
+ match(TestClass.normalFunction).wasNotCalled("unwanted argument");
699
+ }).toThrow('wasNotCalled does not take arguments');
657
700
  });
658
701
 
659
702
  it('should throw an exception when invoked on a non-spy', shouldThrowAnExceptionWhenInvokedOnANonSpy('wasNotCalled'));
@@ -701,7 +744,7 @@ describe("jasmine.Matchers", function() {
701
744
  TestClass.spyFunction('d', 'e', 'f');
702
745
  var expected = match(TestClass.spyFunction);
703
746
  expect(expected.toHaveBeenCalledWith('a', 'b')).toFail();
704
- expect(lastResult().message).toEqual("Expected spy to have been called with [ 'a', 'b' ] but was called with [ [ 'a', 'b', 'c' ], [ 'd', 'e', 'f' ] ]");
747
+ expect(lastResult().message).toEqual("Expected spy My spy to have been called with [ 'a', 'b' ] but was called with [ [ 'a', 'b', 'c' ], [ 'd', 'e', 'f' ] ]");
705
748
  });
706
749
 
707
750
  it("should return a decent message when inverted", function() {
@@ -709,7 +752,7 @@ describe("jasmine.Matchers", function() {
709
752
  TestClass.spyFunction('d', 'e', 'f');
710
753
  var expected = match(TestClass.spyFunction);
711
754
  expect(expected.not.toHaveBeenCalledWith('a', 'b', 'c')).toFail();
712
- expect(lastResult().message).toEqual("Expected spy not to have been called with [ 'a', 'b', 'c' ] but was called with [ [ 'a', 'b', 'c' ], [ 'd', 'e', 'f' ] ]");
755
+ expect(lastResult().message).toEqual("Expected spy My spy not to have been called with [ 'a', 'b', 'c' ] but was called with [ [ 'a', 'b', 'c' ], [ 'd', 'e', 'f' ] ]");
713
756
  });
714
757
 
715
758
  it('should throw an exception when invoked on a non-spy', shouldThrowAnExceptionWhenInvokedOnANonSpy('toHaveBeenCalledWith'));
@@ -18,9 +18,9 @@ describe("jasmine.MultiReporter", function() {
18
18
  delegate[methodName] = jasmine.createSpy(methodName);
19
19
  this.actual[methodName]("whatever argument");
20
20
 
21
- return delegate[methodName].wasCalled
22
- && delegate[methodName].mostRecentCall.args.length == 1
23
- && delegate[methodName].mostRecentCall.args[0] == "whatever argument";
21
+ return delegate[methodName].wasCalled &&
22
+ delegate[methodName].mostRecentCall.args.length == 1 &&
23
+ delegate[methodName].mostRecentCall.args[0] == "whatever argument";
24
24
  }
25
25
  });
26
26
 
@@ -58,12 +58,6 @@ describe("jasmine.pp", function () {
58
58
  }
59
59
  });
60
60
 
61
- it("should stringify HTML nodes properly", function() {
62
- var sampleNode = document.createElement('div');
63
- sampleNode.innerHTML = 'foo<b>bar</b>';
64
- expect(jasmine.pp(sampleNode)).toEqual("HTMLNode");
65
- expect(jasmine.pp({foo: sampleNode})).toEqual("{ foo : HTMLNode }");
66
- });
67
61
 
68
62
  it('should not do HTML escaping of strings', function() {
69
63
  expect(jasmine.pp('some <b>html string</b> &', false)).toEqual('\'some <b>html string</b> &\'');
@@ -54,7 +54,7 @@ describe("jasmine spec running", function () {
54
54
  this.expect(foo).toEqual('baz');
55
55
  });
56
56
 
57
- specWithMultipleExpectations = env.it('spec with multiple assertions').runs(function () {
57
+ specWithMultipleExpectations = env.it('spec with multiple expectations').runs(function () {
58
58
  var foo = 'bar';
59
59
  var baz = 'quux';
60
60
 
@@ -1225,6 +1225,9 @@ describe("jasmine spec running", function () {
1225
1225
  this.expect(true).toEqual(true);
1226
1226
  });
1227
1227
  });
1228
+
1229
+ throw new Error("fake error");
1230
+
1228
1231
  });
1229
1232
  } catch(e) {
1230
1233
  }
@@ -1240,14 +1243,16 @@ describe("jasmine spec running", function () {
1240
1243
 
1241
1244
  expect(specs.join('')).toMatch(new RegExp(
1242
1245
  'Spec: outer1 inner1 should thingy.' +
1243
- 'Result: Passed.' +
1244
- 'Spec: outer1 encountered a declaration exception.' +
1245
- 'Result: Error: fake error.*' +
1246
- 'Spec: outer1 inner2 should other thingy.' +
1247
- 'Result: Passed.' +
1248
- 'Spec: outer2 should xxx.' +
1249
- 'Result: Passed.'
1250
- ));
1246
+ 'Result: Passed.' +
1247
+ 'Spec: outer1 inner1 encountered a declaration exception.' +
1248
+ 'Result: Error: fake error.*' +
1249
+ 'Spec: outer1 inner2 should other thingy.' +
1250
+ 'Result: Passed.' +
1251
+ 'Spec: outer1 encountered a declaration exception.' +
1252
+ 'Result: Error: fake error.*' +
1253
+ 'Spec: outer2 should xxx.' +
1254
+ 'Result: Passed.'
1255
+ ));
1251
1256
  });
1252
1257
 
1253
1258
  });
@@ -38,7 +38,7 @@ describe('Spec', function () {
38
38
 
39
39
  it('getFullName returns suite & spec description', function () {
40
40
  var spec = new jasmine.Spec(env, suite, 'spec 1');
41
- expect(spec.getFullName()).toEqual('suite 1 spec 1.')
41
+ expect(spec.getFullName()).toEqual('suite 1 spec 1.');
42
42
  });
43
43
 
44
44
  describe('results', function () {
@@ -25,7 +25,6 @@ describe("jasmine.util", function() {
25
25
  it("should return true if the argument is an array", function() {
26
26
  expect(jasmine.isArray_([])).toBe(true);
27
27
  expect(jasmine.isArray_(['a'])).toBe(true);
28
- expect(jasmine.isArray_(new Array())).toBe(true);
29
28
  });
30
29
 
31
30
  it("should return false if the argument is not an array", function() {
@@ -10,6 +10,37 @@ describe('WaitsForBlock', function () {
10
10
  onComplete = jasmine.createSpy("onComplete");
11
11
  });
12
12
 
13
+ describe("jasmine.VERBOSE", function() {
14
+ var jasmineVerboseOriginal;
15
+ beforeEach(function() {
16
+ jasmineVerboseOriginal = jasmine.VERBOSE;
17
+ spyOn(env.reporter, 'log');
18
+
19
+ });
20
+ it('do not show information if jasmine.VERBOSE is set to false', function () {
21
+ jasmine.VERBOSE = false;
22
+ var latchFunction = function() {
23
+ return true;
24
+ };
25
+ var block = new jasmine.WaitsForBlock(env, timeout, latchFunction, message, spec);
26
+ expect(env.reporter.log).not.toHaveBeenCalled();
27
+ block.execute(onComplete);
28
+ expect(env.reporter.log).not.toHaveBeenCalled();
29
+ jasmine.VERBOSE = jasmineVerboseOriginal;
30
+ });
31
+ it('show information if jasmine.VERBOSE is set to true', function () {
32
+ jasmine.VERBOSE = true;
33
+ var latchFunction = function() {
34
+ return true;
35
+ };
36
+ var block = new jasmine.WaitsForBlock(env, timeout, latchFunction, message, spec);
37
+ expect(env.reporter.log).not.toHaveBeenCalled();
38
+ block.execute(onComplete);
39
+ expect(env.reporter.log).toHaveBeenCalled();
40
+ jasmine.VERBOSE = jasmineVerboseOriginal;
41
+ });
42
+ });
43
+
13
44
  it('onComplete should be called if the latchFunction returns true', function () {
14
45
  var latchFunction = function() {
15
46
  return true;
@@ -84,4 +115,4 @@ describe('WaitsForBlock', function () {
84
115
  expect(onComplete).toHaveBeenCalled();
85
116
  });
86
117
  });
87
- });
118
+ });