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.
- data/README.rdoc +10 -2
- data/config/routes.rb +1 -1
- data/lib/evergreen.rb +2 -6
- data/lib/evergreen/application.rb +38 -59
- data/lib/evergreen/cli.rb +2 -2
- data/lib/evergreen/runner.rb +6 -3
- data/lib/evergreen/server.rb +1 -5
- data/lib/evergreen/suite.rb +1 -13
- data/lib/evergreen/tasks.rb +1 -1
- data/lib/evergreen/version.rb +1 -1
- data/lib/jasmine/Contribute.markdown +44 -0
- data/lib/jasmine/Gemfile +4 -6
- data/lib/jasmine/MIT.LICENSE +1 -1
- data/lib/jasmine/README.markdown +17 -14
- data/lib/jasmine/Rakefile +21 -170
- data/lib/jasmine/Release.markdown +40 -0
- data/lib/jasmine/images/jasmine_favicon.png +0 -0
- data/lib/jasmine/jasmine-core.gemspec +22 -0
- data/lib/jasmine/jshint/jshint.js +5919 -0
- data/lib/jasmine/jshint/run.js +99 -0
- data/lib/jasmine/lib/jasmine-core.rb +36 -0
- data/lib/jasmine/lib/jasmine-core/example/SpecRunner.html +54 -0
- data/lib/jasmine/{example → lib/jasmine-core/example}/spec/PlayerSpec.js +0 -0
- data/lib/jasmine/{example → lib/jasmine-core/example}/spec/SpecHelper.js +3 -3
- data/lib/jasmine/{example → lib/jasmine-core/example}/src/Player.js +0 -0
- data/lib/jasmine/{example → lib/jasmine-core/example}/src/Song.js +0 -0
- data/lib/jasmine/lib/{jasmine-html.js → jasmine-core/jasmine-html.js} +6 -4
- data/lib/jasmine/lib/{jasmine.css → jasmine-core/jasmine.css} +0 -0
- data/lib/jasmine/lib/{jasmine.js → jasmine-core/jasmine.js} +103 -48
- data/lib/jasmine/lib/{json2.js → jasmine-core/json2.js} +0 -0
- data/lib/jasmine/lib/jasmine-core/version.rb +6 -0
- data/lib/jasmine/spec/console/ConsoleReporterSpec.js +451 -0
- data/lib/jasmine/spec/{suites → core}/BaseSpec.js +0 -0
- data/lib/jasmine/spec/{suites → core}/CustomMatchersSpec.js +0 -0
- data/lib/jasmine/spec/{suites → core}/EnvSpec.js +3 -2
- data/lib/jasmine/spec/{suites → core}/ExceptionsSpec.js +46 -4
- data/lib/jasmine/spec/{suites → core}/JsApiReporterSpec.js +1 -1
- data/lib/jasmine/spec/{suites → core}/MatchersSpec.js +87 -44
- data/lib/jasmine/spec/{suites → core}/MockClockSpec.js +0 -0
- data/lib/jasmine/spec/{suites → core}/MultiReporterSpec.js +3 -3
- data/lib/jasmine/spec/{suites → core}/NestedResultsSpec.js +0 -0
- data/lib/jasmine/spec/{suites → core}/PrettyPrintSpec.js +0 -6
- data/lib/jasmine/spec/{suites → core}/QueueSpec.js +0 -0
- data/lib/jasmine/spec/{suites → core}/ReporterSpec.js +0 -0
- data/lib/jasmine/spec/{suites → core}/RunnerSpec.js +0 -0
- data/lib/jasmine/spec/{suites → core}/SpecRunningSpec.js +14 -9
- data/lib/jasmine/spec/{suites → core}/SpecSpec.js +1 -1
- data/lib/jasmine/spec/{suites → core}/SpySpec.js +0 -0
- data/lib/jasmine/spec/{suites → core}/SuiteSpec.js +0 -0
- data/lib/jasmine/spec/{suites → core}/UtilSpec.js +0 -1
- data/lib/jasmine/spec/{suites → core}/WaitsForBlockSpec.js +32 -1
- data/lib/jasmine/spec/html/MatchersHtmlSpec.js +38 -0
- data/lib/jasmine/spec/html/PrettyPrintHtmlSpec.js +8 -0
- data/lib/jasmine/spec/{suites → html}/TrivialReporterSpec.js +3 -2
- data/lib/jasmine/spec/node_suite.js +127 -0
- data/lib/jasmine/spec/runner.html +44 -45
- data/lib/jasmine/spec/templates/runner.html.erb +49 -0
- data/lib/jasmine/spec/templates/script_tag.html.erb +1 -0
- data/lib/jasmine/src/SourcesList.json +7 -0
- data/lib/jasmine/src/console/ConsoleReporter.js +177 -0
- data/lib/jasmine/src/{Block.js → core/Block.js} +1 -1
- data/lib/jasmine/src/{Env.js → core/Env.js} +13 -8
- data/lib/jasmine/src/{JsApiReporter.js → core/JsApiReporter.js} +0 -0
- data/lib/jasmine/src/{Matchers.js → core/Matchers.js} +24 -7
- data/lib/jasmine/src/{MultiReporter.js → core/MultiReporter.js} +0 -0
- data/lib/jasmine/src/{NestedResults.js → core/NestedResults.js} +0 -0
- data/lib/jasmine/src/{PrettyPrinter.js → core/PrettyPrinter.js} +2 -1
- data/lib/jasmine/src/{Queue.js → core/Queue.js} +0 -0
- data/lib/jasmine/src/{Reporter.js → core/Reporter.js} +0 -0
- data/lib/jasmine/src/{Runner.js → core/Runner.js} +1 -1
- data/lib/jasmine/src/{Spec.js → core/Spec.js} +2 -1
- data/lib/jasmine/src/{Suite.js → core/Suite.js} +1 -1
- data/lib/jasmine/src/{WaitsBlock.js → core/WaitsBlock.js} +3 -1
- data/lib/jasmine/src/{WaitsForBlock.js → core/WaitsForBlock.js} +4 -2
- data/lib/jasmine/src/{base.js → core/base.js} +52 -24
- data/lib/jasmine/src/{mock-timeout.js → core/mock-timeout.js} +0 -0
- data/lib/jasmine/src/{util.js → core/util.js} +1 -1
- data/lib/jasmine/src/html/TrivialReporter.js +6 -4
- data/lib/jasmine/src/templates/example_project_jasmine_tags.html.erb +3 -0
- data/lib/jasmine/src/templates/version.js.erb +6 -0
- data/lib/jasmine/src/templates/version.rb.erb +6 -0
- data/lib/jasmine/src/version.js +6 -0
- data/lib/jasmine/src/version.json +2 -2
- data/lib/jasmine/tasks/build_dist.rb +48 -0
- data/lib/jasmine/tasks/build_specs.rb +50 -0
- data/lib/jasmine/tasks/docs.rb +17 -0
- data/lib/jasmine/tasks/helpers.rb +50 -0
- data/lib/jasmine/tasks/pages.rb +13 -0
- data/lib/jasmine/tasks/spec.rb +37 -0
- data/lib/jasmine/tasks/standalone.rb +91 -0
- data/lib/jasmine/tasks/version.rb +5 -0
- data/lib/tasks/evergreen.rake +1 -1
- data/spec/evergreen_spec.rb +6 -7
- data/spec/runner_spec.rb +1 -1
- data/spec/spec_helper.rb +5 -8
- metadata +95 -77
- data/lib/jasmine/cruise_config.rb +0 -21
- data/lib/jasmine/example/SpecRunner.html +0 -27
- 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
File without changes
|
File without changes
|
@@ -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 =
|
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
|
-
|
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
|
-
|
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
|
});
|
@@ -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(
|
72
|
-
expect((match(
|
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
|
-
|
81
|
-
|
82
|
-
|
83
|
-
expect((match(
|
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(
|
352
|
-
|
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(
|
355
|
-
|
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
|
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(
|
544
|
-
|
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(
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
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(
|
627
|
-
|
628
|
-
|
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(
|
655
|
-
|
656
|
-
|
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'));
|
File without changes
|
@@ -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
|
-
|
23
|
-
|
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
|
|
File without changes
|
@@ -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> &\'');
|
File without changes
|
File without changes
|
File without changes
|
@@ -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
|
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
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
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 () {
|
File without changes
|
File without changes
|
@@ -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
|
+
});
|