evergreen 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +15 -0
  2. data/README.rdoc +8 -6
  3. data/lib/evergreen.rb +8 -6
  4. data/lib/evergreen/application.rb +2 -5
  5. data/lib/evergreen/helper.rb +33 -0
  6. data/lib/evergreen/runner.rb +1 -1
  7. data/lib/evergreen/server.rb +1 -0
  8. data/lib/evergreen/suite.rb +6 -0
  9. data/lib/evergreen/version.rb +1 -1
  10. data/lib/evergreen/views/run.erb +16 -6
  11. data/lib/jasmine/Contribute.markdown +8 -7
  12. data/lib/jasmine/Gemfile +0 -1
  13. data/lib/jasmine/README.markdown +1 -8
  14. data/lib/jasmine/Rakefile +26 -15
  15. data/lib/jasmine/Release.markdown +8 -6
  16. data/lib/jasmine/config.rb +29 -0
  17. data/lib/jasmine/jasmine-core.gemspec +9 -2
  18. data/lib/jasmine/jasmine_dev.thor +1 -0
  19. data/lib/jasmine/jshint/run.js +1 -1
  20. data/lib/jasmine/lib/jasmine-core/jasmine-html.js +427 -1
  21. data/lib/jasmine/lib/jasmine-core/jasmine.css +81 -166
  22. data/lib/jasmine/lib/jasmine-core/jasmine.js +245 -192
  23. data/lib/jasmine/lib/jasmine-core/version.rb +1 -1
  24. data/lib/jasmine/spec/core/MatchersSpec.js +273 -0
  25. data/lib/jasmine/spec/core/PrettyPrintSpec.js +7 -0
  26. data/lib/jasmine/spec/html/HTMLReporterSpec.js +209 -0
  27. data/lib/jasmine/spec/node_suite.js +2 -2
  28. data/lib/jasmine/spec/runner.html +10 -3
  29. data/lib/jasmine/spec/spec_helper.rb +51 -0
  30. data/lib/jasmine/spec/tasks/build_distribution_spec.rb +33 -0
  31. data/lib/jasmine/spec/tasks/build_github_pages_spec.rb +69 -0
  32. data/lib/jasmine/spec/tasks/build_standalone_distribution_spec.rb +109 -0
  33. data/lib/jasmine/spec/tasks/build_standalone_runner_spec.rb +63 -0
  34. data/lib/jasmine/spec/tasks/count_specs_spec.rb +26 -0
  35. data/lib/jasmine/spec/tasks/execute_specs_spec.rb +81 -0
  36. data/lib/jasmine/spec/tasks/jshint_spec.rb +39 -0
  37. data/lib/jasmine/spec/tasks/release_spec.rb +39 -0
  38. data/lib/jasmine/spec/tasks/version_spec.rb +55 -0
  39. data/lib/jasmine/spec/templates/runner.html.erb +3 -3
  40. data/lib/jasmine/src/core/Env.js +10 -2
  41. data/lib/jasmine/src/core/Matchers.js +33 -4
  42. data/lib/jasmine/src/core/PrettyPrinter.js +2 -2
  43. data/lib/jasmine/src/core/base.js +15 -0
  44. data/lib/jasmine/src/core/mock-timeout.js +0 -0
  45. data/lib/jasmine/src/html/HtmlReporter.js +101 -0
  46. data/lib/jasmine/src/html/HtmlReporterHelpers.js +60 -0
  47. data/lib/jasmine/src/html/ReporterView.js +164 -0
  48. data/lib/jasmine/src/html/SpecView.js +79 -0
  49. data/lib/jasmine/src/html/SuiteView.js +22 -0
  50. data/lib/jasmine/src/html/TrivialReporter.js +3 -1
  51. data/lib/jasmine/src/html/_HTMLReporter.scss +302 -0
  52. data/lib/jasmine/src/html/_TrivialReporter.scss +169 -0
  53. data/lib/jasmine/src/html/jasmine.css +81 -166
  54. data/lib/jasmine/src/html/jasmine.scss +2 -0
  55. data/lib/jasmine/src/templates/version.js.erb +1 -0
  56. data/lib/jasmine/src/version.js +3 -2
  57. data/lib/jasmine/src/version.json +1 -1
  58. data/lib/jasmine/tasks/jasmine_dev.rb +18 -0
  59. data/lib/jasmine/tasks/jasmine_dev/base.rb +54 -0
  60. data/lib/jasmine/tasks/jasmine_dev/build_distribution.rb +53 -0
  61. data/lib/jasmine/tasks/jasmine_dev/build_github_pages.rb +31 -0
  62. data/lib/jasmine/tasks/jasmine_dev/build_standalone_distribution.rb +49 -0
  63. data/lib/jasmine/tasks/jasmine_dev/build_standalone_runner.rb +59 -0
  64. data/lib/jasmine/tasks/jasmine_dev/count_specs.rb +29 -0
  65. data/lib/jasmine/tasks/jasmine_dev/execute_specs.rb +52 -0
  66. data/lib/jasmine/tasks/jasmine_dev/js_hint.rb +13 -0
  67. data/lib/jasmine/tasks/jasmine_dev/release.rb +16 -0
  68. data/lib/jasmine/tasks/jasmine_dev/sources.rb +32 -0
  69. data/lib/jasmine/tasks/jasmine_dev/version.rb +62 -0
  70. data/spec/helper_spec.rb +25 -0
  71. data/spec/suite1/spec/javascripts/{spec_helper.coffee → helpers/spec_helper.coffee} +0 -0
  72. data/spec/suite1/spec/javascripts/{spec_helper.js → helpers/spec_helper.js} +0 -0
  73. data/spec/suite1/spec/javascripts/templates_spec.js +6 -6
  74. data/spec/suite2/spec/awesome_spec.js +1 -1
  75. data/spec/suite_spec.rb +6 -0
  76. metadata +116 -52
  77. data/lib/jasmine/src/SourcesList.json +0 -7
  78. data/lib/jasmine/tasks/build_dist.rb +0 -48
  79. data/lib/jasmine/tasks/build_specs.rb +0 -50
  80. data/lib/jasmine/tasks/helpers.rb +0 -50
  81. data/lib/jasmine/tasks/pages.rb +0 -13
  82. data/lib/jasmine/tasks/spec.rb +0 -37
  83. data/lib/jasmine/tasks/standalone.rb +0 -91
  84. data/lib/jasmine/tasks/version.rb +0 -5
@@ -0,0 +1,79 @@
1
+ jasmine.HtmlReporter.SpecView = function(spec, dom, views) {
2
+ this.spec = spec;
3
+ this.dom = dom;
4
+ this.views = views;
5
+
6
+ this.symbol = this.createDom('li', { className: 'pending' });
7
+ this.dom.symbolSummary.appendChild(this.symbol);
8
+
9
+ this.summary = this.createDom('div', { className: 'specSummary' },
10
+ this.createDom('a', {
11
+ className: 'description',
12
+ href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
13
+ title: this.spec.getFullName()
14
+ }, this.spec.description)
15
+ );
16
+
17
+ this.detail = this.createDom('div', { className: 'specDetail' },
18
+ this.createDom('a', {
19
+ className: 'description',
20
+ href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
21
+ title: this.spec.getFullName()
22
+ }, this.spec.getFullName())
23
+ );
24
+ };
25
+
26
+ jasmine.HtmlReporter.SpecView.prototype.status = function() {
27
+ return this.getSpecStatus(this.spec);
28
+ };
29
+
30
+ jasmine.HtmlReporter.SpecView.prototype.refresh = function() {
31
+ this.symbol.className = this.status();
32
+
33
+ switch (this.status()) {
34
+ case 'skipped':
35
+ break;
36
+
37
+ case 'passed':
38
+ this.appendSummaryToSuiteDiv();
39
+ break;
40
+
41
+ case 'failed':
42
+ this.appendSummaryToSuiteDiv();
43
+ this.appendFailureDetail();
44
+ break;
45
+ }
46
+ };
47
+
48
+ jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() {
49
+ this.summary.className += ' ' + this.status();
50
+ this.appendToSummary(this.spec, this.summary);
51
+ };
52
+
53
+ jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() {
54
+ this.detail.className += ' ' + this.status();
55
+
56
+ var resultItems = this.spec.results().getItems();
57
+ var messagesDiv = this.createDom('div', { className: 'messages' });
58
+
59
+ for (var i = 0; i < resultItems.length; i++) {
60
+ var result = resultItems[i];
61
+
62
+ if (result.type == 'log') {
63
+ messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
64
+ } else if (result.type == 'expect' && result.passed && !result.passed()) {
65
+ messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
66
+
67
+ if (result.trace.stack) {
68
+ messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
69
+ }
70
+ }
71
+ }
72
+
73
+ if (messagesDiv.childNodes.length > 0) {
74
+ this.detail.appendChild(messagesDiv);
75
+ this.dom.details.appendChild(this.detail);
76
+ }
77
+ };
78
+
79
+ jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);
@@ -0,0 +1,22 @@
1
+ jasmine.HtmlReporter.SuiteView = function(suite, dom, views) {
2
+ this.suite = suite;
3
+ this.dom = dom;
4
+ this.views = views;
5
+
6
+ this.element = this.createDom('div', { className: 'suite' },
7
+ this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(this.suite.getFullName()) }, this.suite.description)
8
+ );
9
+
10
+ this.appendToSummary(this.suite, this.element);
11
+ };
12
+
13
+ jasmine.HtmlReporter.SuiteView.prototype.status = function() {
14
+ return this.getSpecStatus(this.suite);
15
+ };
16
+
17
+ jasmine.HtmlReporter.SuiteView.prototype.refresh = function() {
18
+ this.element.className += " " + this.status();
19
+ };
20
+
21
+ jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView);
22
+
@@ -1,3 +1,5 @@
1
+ /* @deprecated Use jasmine.HtmlReporter instead
2
+ */
1
3
  jasmine.TrivialReporter = function(doc) {
2
4
  this.document = doc || document;
3
5
  this.suiteDivs = {};
@@ -31,7 +33,7 @@ jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarA
31
33
  jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
32
34
  var showPassed, showSkipped;
33
35
 
34
- this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' },
36
+ this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' },
35
37
  this.createDom('div', { className: 'banner' },
36
38
  this.createDom('div', { className: 'logo' },
37
39
  this.createDom('span', { className: 'title' }, "Jasmine"),
@@ -0,0 +1,302 @@
1
+ @import "compass";
2
+
3
+ $line-height: 14px;
4
+ $margin-unit: 14px;
5
+
6
+ $feint-text-color: #aaa;
7
+ $light-text-color: #666;
8
+ $text-color: #333;
9
+
10
+ $page-background-color: #eee;
11
+
12
+ $light-passing-color: #a6b779;
13
+ $passing-color: #5e7d00;
14
+
15
+ $light-failing-color: #cf867e;
16
+ $failing-color: #b03911;
17
+
18
+ $neutral-color: #bababa;
19
+
20
+ $font-size: 11px;
21
+ $large-font-size: 14px;
22
+
23
+ body {
24
+ background-color: $page-background-color;
25
+ padding: 0;
26
+ margin: 5px;
27
+ overflow-y: scroll;
28
+ }
29
+
30
+ #HTMLReporter {
31
+
32
+ font-size: $font-size;
33
+ font-family: Monaco, "Lucida Console", monospace;
34
+ line-height: $line-height;
35
+ color: $text-color;
36
+
37
+ a {
38
+ text-decoration: none;
39
+
40
+ &:hover {
41
+ text-decoration: underline;
42
+ }
43
+ }
44
+
45
+ p, h1, h2, h3, h4, h5, h6 {
46
+ margin: 0;
47
+ line-height: $line-height;
48
+ }
49
+
50
+ .banner,
51
+ .symbolSummary,
52
+ .summary,
53
+ .resultMessage,
54
+ .specDetail .description,
55
+ .alert .bar,
56
+ .stackTrace {
57
+ padding-left: $margin-unit - 5px;
58
+ padding-right: $margin-unit - 5px;
59
+ }
60
+
61
+ // This div is available for testing elements that must be added to the DOM.
62
+ // We position it out of view, so it doesn't obstruct the runner.
63
+ #jasmine_content {
64
+ position: fixed;
65
+ right: 100%;
66
+ }
67
+
68
+ .version {
69
+ color: $feint-text-color;
70
+ }
71
+
72
+ //--- Banner ---//
73
+
74
+ .banner {
75
+ margin-top: $line-height;
76
+ }
77
+
78
+ .duration {
79
+ color: $feint-text-color;
80
+ float: right;
81
+ }
82
+
83
+ //--- Symbol summary ---//
84
+
85
+ .symbolSummary {
86
+ @include clearfix;
87
+ margin: $line-height 0;
88
+
89
+ li {
90
+ display: block;
91
+ float: left;
92
+ height: $line-height / 2;
93
+ width: $line-height;
94
+ margin-bottom: $line-height / 2;
95
+
96
+ //opacity: .9;
97
+
98
+ font-size: 16px;
99
+
100
+ &.passed {
101
+ font-size: 14px;
102
+
103
+ &:before{
104
+ color: $passing-color;
105
+ content: "\02022";
106
+ }
107
+ }
108
+
109
+ &.failed {
110
+ line-height: ($line-height / 2) + 2;
111
+
112
+ &:before{
113
+ color: $failing-color;
114
+ content: "x";
115
+ font-weight: bold;
116
+ margin-left: -1px;
117
+ }
118
+ }
119
+
120
+ &.skipped {
121
+ font-size: 14px;
122
+
123
+ &:before{
124
+ color: $neutral-color;
125
+ content: "\02022";
126
+ }
127
+ }
128
+
129
+ &.pending{
130
+ line-height: ($line-height / 2) + 4;
131
+
132
+ &:before {
133
+ color: $feint-text-color;
134
+ content: "-";
135
+ }
136
+ }
137
+ }
138
+ }
139
+
140
+ //--- Alert ---//
141
+
142
+ .bar {
143
+ line-height: $line-height * 2;
144
+ font-size: $large-font-size;
145
+
146
+ display: block;
147
+ color: #eee;
148
+ }
149
+
150
+ .runningAlert {
151
+ background-color: $light-text-color;
152
+ }
153
+
154
+ .skippedAlert {
155
+ background-color: $feint-text-color;
156
+
157
+ &:first-child {
158
+ background-color: $text-color;
159
+ }
160
+
161
+ &:hover {
162
+ text-decoration: none;
163
+ color: white;
164
+ text-decoration: underline;
165
+ }
166
+ }
167
+
168
+ .passingAlert {
169
+ background-color: $light-passing-color;
170
+
171
+ &:first-child {
172
+ background-color: $passing-color;
173
+ }
174
+ }
175
+
176
+ .failingAlert {
177
+ background-color: $light-failing-color;
178
+
179
+ &:first-child {
180
+ background-color: $failing-color
181
+ }
182
+ }
183
+
184
+ //--- Results ---//
185
+
186
+ .results {
187
+ margin-top: $line-height;
188
+ }
189
+
190
+ //--- Results menu ---//
191
+
192
+ #details {
193
+ display: none;
194
+ }
195
+
196
+ .resultsMenu,
197
+ .resultsMenu a {
198
+ background-color: #fff;
199
+ color: $text-color;
200
+ }
201
+
202
+ &.showDetails {
203
+
204
+ .summaryMenuItem {
205
+ font-weight: normal;
206
+ text-decoration: inherit;
207
+
208
+ &:hover {
209
+ text-decoration: underline;
210
+ }
211
+ }
212
+
213
+ .detailsMenuItem {
214
+ font-weight: bold;
215
+ text-decoration: underline;
216
+ }
217
+
218
+ .summary {
219
+ display: none;
220
+ }
221
+
222
+ #details {
223
+ display: block;
224
+ }
225
+ }
226
+
227
+ .summaryMenuItem {
228
+ font-weight: bold;
229
+ text-decoration: underline;
230
+ }
231
+
232
+ //--- Results summary ---//
233
+
234
+ .summary {
235
+ margin-top: $margin-unit;
236
+
237
+ .suite .suite, .specSummary {
238
+ margin-left: $margin-unit;
239
+ }
240
+
241
+ .specSummary {
242
+ &.passed a {
243
+ color: $passing-color;
244
+ }
245
+ &.failed a {
246
+ color: $failing-color;
247
+ }
248
+ }
249
+ }
250
+
251
+ .description+.suite {
252
+ margin-top: 0;
253
+ }
254
+
255
+ .suite {
256
+ margin-top: $margin-unit;
257
+
258
+ a {
259
+ color: $text-color;
260
+ }
261
+ }
262
+
263
+ //--- Results details ---//
264
+
265
+ #details {
266
+ .specDetail {
267
+ margin-bottom: $line-height * 2;
268
+
269
+ .description {
270
+ //line-height: $line-height * 2;
271
+ display: block;
272
+
273
+ color: white;
274
+ background-color: $failing-color;
275
+
276
+ //font-size: $large-font-size;
277
+ }
278
+ }
279
+ }
280
+
281
+ .resultMessage {
282
+ padding-top: $line-height;
283
+
284
+ color: $text-color;
285
+ }
286
+
287
+ .resultMessage span.result {
288
+ display: block;
289
+ }
290
+
291
+ .stackTrace {
292
+ margin: 5px 0 0 0;
293
+ max-height: $line-height * 16;
294
+ overflow: auto;
295
+ line-height: 18px;
296
+
297
+ color: $light-text-color;
298
+ border: 1px solid #ddd;
299
+ background: white;
300
+ white-space: pre;
301
+ }
302
+ }
@@ -0,0 +1,169 @@
1
+ #TrivialReporter {
2
+ padding: 8px 13px;
3
+ position: absolute;
4
+ top: 0;
5
+ bottom: 0;
6
+ left: 0;
7
+ right: 0;
8
+ overflow-y: scroll;
9
+
10
+ background-color: white;
11
+ font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
12
+
13
+ a:visited, a {
14
+ color: #303;
15
+ }
16
+
17
+ a:hover, a:active {
18
+ color: blue;
19
+ }
20
+
21
+ .run_spec {
22
+ float:right;
23
+ padding-right: 5px;
24
+ font-size: .8em;
25
+ text-decoration: none;
26
+ }
27
+
28
+ .banner {
29
+ color: #303;
30
+ background-color: #fef;
31
+ padding: 5px;
32
+ }
33
+
34
+ .logo {
35
+ float: left;
36
+ font-size: 1.1em;
37
+ padding-left: 5px;
38
+ }
39
+
40
+ .logo .version {
41
+ font-size: .6em;
42
+ padding-left: 1em;
43
+ }
44
+
45
+ .runner.running {
46
+ background-color: yellow;
47
+ }
48
+
49
+
50
+ .options {
51
+ text-align: right;
52
+ font-size: .8em;
53
+ }
54
+
55
+
56
+
57
+
58
+ .suite {
59
+ border: 1px outset gray;
60
+ margin: 5px 0;
61
+ padding-left: 1em;
62
+ }
63
+
64
+ .suite .suite {
65
+ margin: 5px;
66
+ }
67
+
68
+ .suite.passed {
69
+ background-color: #dfd;
70
+ }
71
+
72
+ .suite.failed {
73
+ background-color: #fdd;
74
+ }
75
+
76
+ .spec {
77
+ margin: 5px;
78
+ padding-left: 1em;
79
+ clear: both;
80
+ }
81
+
82
+ .spec.failed, .spec.passed, .spec.skipped {
83
+ padding-bottom: 5px;
84
+ border: 1px solid gray;
85
+ }
86
+
87
+ .spec.failed {
88
+ background-color: #fbb;
89
+ border-color: red;
90
+ }
91
+
92
+ .spec.passed {
93
+ background-color: #bfb;
94
+ border-color: green;
95
+ }
96
+
97
+ .spec.skipped {
98
+ background-color: #bbb;
99
+ }
100
+
101
+ .messages {
102
+ border-left: 1px dashed gray;
103
+ padding-left: 1em;
104
+ padding-right: 1em;
105
+ }
106
+
107
+ .passed {
108
+ background-color: #cfc;
109
+ display: none;
110
+ }
111
+
112
+ .failed {
113
+ background-color: #fbb;
114
+ }
115
+
116
+ .skipped {
117
+ color: #777;
118
+ background-color: #eee;
119
+ display: none;
120
+ }
121
+
122
+
123
+ /*.resultMessage {*/
124
+ /*white-space: pre;*/
125
+ /*}*/
126
+
127
+ .resultMessage span.result {
128
+ display: block;
129
+ line-height: 2em;
130
+ color: black;
131
+ }
132
+
133
+ .resultMessage .mismatch {
134
+ color: black;
135
+ }
136
+
137
+ .stackTrace {
138
+ white-space: pre;
139
+ font-size: .8em;
140
+ margin-left: 10px;
141
+ max-height: 5em;
142
+ overflow: auto;
143
+ border: 1px inset red;
144
+ padding: 1em;
145
+ background: #eef;
146
+ }
147
+
148
+ .finished-at {
149
+ padding-left: 1em;
150
+ font-size: .6em;
151
+ }
152
+
153
+ &.show-passed .passed,
154
+ &.show-skipped .skipped {
155
+ display: block;
156
+ }
157
+
158
+ #jasmine_content {
159
+ position:fixed;
160
+ right: 100%;
161
+ }
162
+
163
+ .runner {
164
+ border: 1px solid gray;
165
+ display: block;
166
+ margin: 5px 0;
167
+ padding: 2px 0 2px 10px;
168
+ }
169
+ }