rspec-core 2.4.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data/.gitignore +1 -0
  2. data/Gemfile +9 -4
  3. data/Guardfile +3 -3
  4. data/README.md +1 -1
  5. data/features/.nav +7 -2
  6. data/features/{README.markdown → Autotest.md} +17 -20
  7. data/features/Changelog.md +57 -2
  8. data/features/README.md +17 -0
  9. data/features/Upgrade.md +8 -66
  10. data/features/command_line/configure.feature +2 -2
  11. data/features/command_line/example_name_option.feature +10 -10
  12. data/features/command_line/exit_status.feature +4 -4
  13. data/features/command_line/line_number_appended_to_path.feature +11 -11
  14. data/features/command_line/line_number_option.feature +9 -9
  15. data/features/command_line/tag.feature +9 -9
  16. data/features/configuration/custom_settings.feature +3 -3
  17. data/features/configuration/fail_fast.feature +3 -3
  18. data/features/configuration/read_options_from_file.feature +4 -4
  19. data/features/example_groups/shared_example_group.feature +4 -4
  20. data/features/expectation_framework_integration/configure_expectation_framework.feature +8 -9
  21. data/features/filtering/exclusion_filters.feature +1 -1
  22. data/features/filtering/run_all_when_everything_filtered.feature +1 -1
  23. data/features/formatters/custom_formatter.feature +17 -13
  24. data/features/helper_methods/arbitrary_methods.feature +40 -0
  25. data/features/helper_methods/let.feature +50 -0
  26. data/features/hooks/before_and_after_hooks.feature +10 -10
  27. data/features/hooks/filtering.feature +37 -20
  28. data/features/metadata/described_class.feature +1 -1
  29. data/features/mock_framework_integration/use_flexmock.feature +1 -1
  30. data/features/mock_framework_integration/use_mocha.feature +1 -1
  31. data/features/mock_framework_integration/use_rr.feature +1 -1
  32. data/features/mock_framework_integration/use_rspec.feature +1 -1
  33. data/features/spec_files/arbitrary_file_suffix.feature +1 -1
  34. data/features/step_definitions/additional_cli_steps.rb +1 -1
  35. data/features/subject/attribute_of_subject.feature +2 -2
  36. data/features/subject/explicit_subject.feature +5 -5
  37. data/features/subject/implicit_receiver.feature +2 -2
  38. data/features/subject/implicit_subject.feature +2 -2
  39. data/lib/autotest/rspec2.rb +63 -13
  40. data/lib/rspec/core/configuration.rb +0 -1
  41. data/lib/rspec/core/configuration_options.rb +15 -12
  42. data/lib/rspec/core/example.rb +14 -6
  43. data/lib/rspec/core/example_group.rb +5 -4
  44. data/lib/rspec/core/formatters/base_formatter.rb +1 -1
  45. data/lib/rspec/core/formatters/documentation_formatter.rb +1 -1
  46. data/lib/rspec/core/formatters/html_formatter.rb +131 -32
  47. data/lib/rspec/core/formatters/snippet_extractor.rb +1 -1
  48. data/lib/rspec/core/hooks.rb +16 -1
  49. data/lib/rspec/core/option_parser.rb +6 -6
  50. data/lib/rspec/core/rake_task.rb +1 -1
  51. data/lib/rspec/core/subject.rb +7 -7
  52. data/lib/rspec/core/version.rb +1 -1
  53. data/rspec-core.gemspec +0 -12
  54. data/script/FullBuildRakeFile +63 -0
  55. data/script/cucumber +1 -0
  56. data/script/full_build +1 -0
  57. data/script/spec +1 -0
  58. data/spec/autotest/failed_results_re_spec.rb +22 -5
  59. data/spec/autotest/rspec_spec.rb +132 -16
  60. data/spec/rspec/core/configuration_options_spec.rb +38 -6
  61. data/spec/rspec/core/example_group_spec.rb +15 -64
  62. data/spec/rspec/core/formatters/base_formatter_spec.rb +23 -0
  63. data/spec/rspec/core/formatters/html_formatted-1.8.6.html +150 -48
  64. data/spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html +151 -49
  65. data/spec/rspec/core/formatters/html_formatted-1.8.7.html +150 -48
  66. data/spec/rspec/core/formatters/html_formatted-1.9.1.html +150 -48
  67. data/spec/rspec/core/formatters/html_formatted-1.9.2.html +150 -48
  68. data/spec/rspec/core/formatters/text_mate_formatted-1.8.6.html +150 -48
  69. data/spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html +151 -49
  70. data/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +150 -48
  71. data/spec/rspec/core/formatters/text_mate_formatted-1.9.1.html +150 -48
  72. data/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +150 -48
  73. data/spec/rspec/core/hooks_filtering_spec.rb +49 -0
  74. data/spec/rspec/core/rake_task_spec.rb +3 -3
  75. data/spec/rspec/core/subject_spec.rb +81 -0
  76. metadata +20 -22
  77. data/History.markdown +0 -186
  78. data/Upgrade.markdown +0 -345
@@ -18,24 +18,78 @@
18
18
  </style>
19
19
  <script type="text/javascript">
20
20
  // <![CDATA[
21
+
22
+ function addClass(element_id, classname) {
23
+ document.getElementById(element_id).className += (" " + classname);
24
+ }
25
+
26
+ function removeClass(element_id, classname) {
27
+ var elem = document.getElementById(element_id);
28
+ var classlist = elem.className.replace(classname,'');
29
+ elem.className = classlist;
30
+ }
31
+
21
32
  function moveProgressBar(percentDone) {
22
33
  document.getElementById("rspec-header").style.width = percentDone +"%";
23
34
  }
35
+
24
36
  function makeRed(element_id) {
25
- document.getElementById(element_id).style.background = '#C40D0D';
26
- document.getElementById(element_id).style.color = '#FFFFFF';
37
+ removeClass(element_id, 'passed');
38
+ removeClass(element_id, 'not_implemented');
39
+ addClass(element_id,'failed');
27
40
  }
28
41
 
29
42
  function makeYellow(element_id) {
30
- if (element_id == "rspec-header" && document.getElementById(element_id).style.background != '#C40D0D')
31
- {
32
- document.getElementById(element_id).style.background = '#FAF834';
33
- document.getElementById(element_id).style.color = '#000000';
43
+ var elem = document.getElementById(element_id);
44
+ if (elem.className.indexOf("failed") == -1) { // class doesn't includes failed
45
+ if (elem.className.indexOf("not_implemented") == -1) { // class doesn't include not_implemented
46
+ removeClass(element_id, 'passed');
47
+ addClass(element_id,'not_implemented');
48
+ }
34
49
  }
35
- else
36
- {
37
- document.getElementById(element_id).style.background = '#FAF834';
38
- document.getElementById(element_id).style.color = '#000000';
50
+ }
51
+
52
+ function apply_filters() {
53
+ var passed_filter = document.getElementById('passed_checkbox').checked;
54
+ var failed_filter = document.getElementById('failed_checkbox').checked;
55
+ var pending_filter = document.getElementById('pending_checkbox').checked;
56
+
57
+ assign_display_style("example passed", passed_filter);
58
+ assign_display_style("example failed", failed_filter);
59
+ assign_display_style("example not_implemented", pending_filter);
60
+
61
+ assign_display_style_for_group("example_group passed", passed_filter);
62
+ assign_display_style_for_group("example_group not_implemented", pending_filter, pending_filter || passed_filter);
63
+ assign_display_style_for_group("example_group failed", failed_filter, failed_filter || pending_filter || passed_filter);
64
+ }
65
+
66
+ function get_display_style(display_flag) {
67
+ var style_mode = 'none';
68
+ if (display_flag == true) {
69
+ style_mode = 'block';
70
+ }
71
+ return style_mode;
72
+ }
73
+
74
+ function assign_display_style(classname, display_flag) {
75
+ var style_mode = get_display_style(display_flag);
76
+ var elems = document.getElementsByClassName(classname)
77
+ for (var i=0; i<elems.length;i++) {
78
+ elems[i].style.display = style_mode;
79
+ }
80
+ }
81
+
82
+ function assign_display_style_for_group(classname, display_flag, subgroup_flag) {
83
+ var display_style_mode = get_display_style(display_flag);
84
+ var subgroup_style_mode = get_display_style(subgroup_flag);
85
+ var elems = document.getElementsByClassName(classname)
86
+ for (var i=0; i<elems.length;i++) {
87
+ var style_mode = display_style_mode;
88
+ if ((display_flag != subgroup_flag) && (elems[i].getElementsByTagName('dt')[0].innerHTML.indexOf(", ") != -1)) {
89
+ elems[i].style.display = subgroup_style_mode;
90
+ } else {
91
+ elems[i].style.display = display_style_mode;
92
+ }
39
93
  }
40
94
  }
41
95
 
@@ -54,13 +108,21 @@ function makeYellow(element_id) {
54
108
  position: absolute;
55
109
  }
56
110
 
111
+ #label {
112
+ float:left;
113
+ }
114
+
115
+ #display-filters {
116
+ float:left;
117
+ padding: 28px 0 0 40%;
118
+ font-family: "Lucida Grande", Helvetica, sans-serif;
119
+ }
120
+
57
121
  #summary {
58
- margin: 0; padding: 5px 10px;
122
+ float:right;
123
+ padding: 5px 10px;
59
124
  font-family: "Lucida Grande", Helvetica, sans-serif;
60
125
  text-align: right;
61
- top: 0px;
62
- right: 0px;
63
- float:right;
64
126
  }
65
127
 
66
128
  #summary p {
@@ -93,30 +155,58 @@ dd {
93
155
  padding: 3px 3px 3px 18px;
94
156
  }
95
157
 
96
- dd.spec.passed {
158
+
159
+ dd.example.passed {
97
160
  border-left: 5px solid #65C400;
98
161
  border-bottom: 1px solid #65C400;
99
162
  background: #DBFFB4; color: #3D7700;
100
163
  }
101
164
 
102
- dd.spec.failed {
103
- border-left: 5px solid #C20000;
104
- border-bottom: 1px solid #C20000;
105
- color: #C20000; background: #FFFBD3;
106
- }
107
-
108
- dd.spec.not_implemented {
165
+ dd.example.not_implemented {
109
166
  border-left: 5px solid #FAF834;
110
167
  border-bottom: 1px solid #FAF834;
111
168
  background: #FCFB98; color: #131313;
112
169
  }
113
170
 
114
- dd.spec.pending_fixed {
171
+ dd.example.pending_fixed {
115
172
  border-left: 5px solid #0000C2;
116
173
  border-bottom: 1px solid #0000C2;
117
174
  color: #0000C2; background: #D3FBFF;
118
175
  }
119
176
 
177
+ dd.example.failed {
178
+ border-left: 5px solid #C20000;
179
+ border-bottom: 1px solid #C20000;
180
+ color: #C20000; background: #FFFBD3;
181
+ }
182
+
183
+
184
+ dt.not_implemented {
185
+ color: #000000; background: #FAF834;
186
+ }
187
+
188
+ dt.pending_fixed {
189
+ color: #FFFFFF; background: #C40D0D;
190
+ }
191
+
192
+ dt.failed {
193
+ color: #FFFFFF; background: #C40D0D;
194
+ }
195
+
196
+
197
+ #rspec-header.not_implemented {
198
+ color: #000000; background: #FAF834;
199
+ }
200
+
201
+ #rspec-header.pending_fixed {
202
+ color: #FFFFFF; background: #C40D0D;
203
+ }
204
+
205
+ #rspec-header.failed {
206
+ color: #FFFFFF; background: #C40D0D;
207
+ }
208
+
209
+
120
210
  .backtrace {
121
211
  color: #000;
122
212
  font-size: 12px;
@@ -172,45 +262,55 @@ a {
172
262
  <h1>RSpec Code Examples</h1>
173
263
  </div>
174
264
 
265
+ <div id="display-filters">
266
+ <input id="passed_checkbox" name="passed_checkbox" type="checkbox" checked onchange="apply_filters()" value="1"> <label for="passed_checkbox">Passed</label>
267
+ <input id="failed_checkbox" name="failed_checkbox" type="checkbox" checked onchange="apply_filters()" value="2"> <label for="failed_checkbox">Failed</label>
268
+ <input id="pending_checkbox" name="pending_checkbox" type="checkbox" checked onchange="apply_filters()" value="3"> <label for="pending_checkbox">Pending</label>
269
+ </div>
270
+
175
271
  <div id="summary">
176
272
  <p id="totals">&nbsp;</p>
177
273
  <p id="duration">&nbsp;</p>
178
274
  </div>
179
275
  </div>
180
276
 
277
+
181
278
  <div class="results">
182
- <div class="example_group">
279
+ <div id="div_group_1" class="example_group passed">
183
280
  <dl style="margin-left: 0px;">
184
- <dt id="example_group_1">pending spec with no implementation</dt>
281
+ <dt id="example_group_1" class="passed">pending spec with no implementation</dt>
185
282
  <script type="text/javascript">makeYellow('rspec-header');</script>
283
+ <script type="text/javascript">makeYellow('div_group_1');</script>
186
284
  <script type="text/javascript">makeYellow('example_group_1');</script>
187
285
  <script type="text/javascript">moveProgressBar('14.2');</script>
188
- <dd class="spec not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: Not Yet Implemented)</span></dd>
286
+ <dd class="example not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: Not Yet Implemented)</span></dd>
189
287
  </dl>
190
288
  </div>
191
- <div class="example_group">
289
+ <div id="div_group_2" class="example_group passed">
192
290
  <dl style="margin-left: 0px;">
193
- <dt id="example_group_2">pending command with block format</dt>
291
+ <dt id="example_group_2" class="passed">pending command with block format</dt>
194
292
  </dl>
195
293
  </div>
196
- <div class="example_group">
294
+ <div id="div_group_3" class="example_group passed">
197
295
  <dl style="margin-left: 15px;">
198
- <dt id="example_group_3">with content that would fail</dt>
296
+ <dt id="example_group_3" class="passed">with content that would fail</dt>
199
297
  <script type="text/javascript">makeYellow('rspec-header');</script>
298
+ <script type="text/javascript">makeYellow('div_group_3');</script>
200
299
  <script type="text/javascript">makeYellow('example_group_3');</script>
201
300
  <script type="text/javascript">moveProgressBar('28.5');</script>
202
- <dd class="spec not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: No reason given)</span></dd>
301
+ <dd class="example not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: No reason given)</span></dd>
203
302
  </dl>
204
303
  </div>
205
- <div class="example_group">
304
+ <div id="div_group_4" class="example_group passed">
206
305
  <dl style="margin-left: 15px;">
207
- <dt id="example_group_4">with content that would pass</dt>
306
+ <dt id="example_group_4" class="passed">with content that would pass</dt>
208
307
  <script type="text/javascript">makeRed('rspec-header');</script>
308
+ <script type="text/javascript">makeRed('div_group_4');</script>
209
309
  <script type="text/javascript">makeRed('example_group_4');</script>
210
310
  <script type="text/javascript">moveProgressBar('42.8');</script>
211
- <dd class="spec pending_fixed">
311
+ <dd class="example pending_fixed">
212
312
  <span class="failed_spec_name">fails</span>
213
- <div class="failure" id="failure_0">
313
+ <div class="failure" id="failure_1">
214
314
  <div class="message"><pre>RSpec::Core::PendingExampleFixedError</pre></div>
215
315
  <div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:18:in `block (3 levels) in <top (required)>'
216
316
  ./spec/rspec/core/formatters/html_formatter_spec.rb:24:in `block (2 levels) in <module:Formatters>'
@@ -228,21 +328,22 @@ a {
228
328
  </dd>
229
329
  </dl>
230
330
  </div>
231
- <div class="example_group">
331
+ <div id="div_group_5" class="example_group passed">
232
332
  <dl style="margin-left: 0px;">
233
- <dt id="example_group_5">passing spec</dt>
333
+ <dt id="example_group_5" class="passed">passing spec</dt>
234
334
  <script type="text/javascript">moveProgressBar('57.1');</script>
235
- <dd class="spec passed"><span class="passed_spec_name">passes</span></dd>
335
+ <dd class="example passed"><span class="passed_spec_name">passes</span></dd>
236
336
  </dl>
237
337
  </div>
238
- <div class="example_group">
338
+ <div id="div_group_6" class="example_group passed">
239
339
  <dl style="margin-left: 0px;">
240
- <dt id="example_group_6">failing spec</dt>
340
+ <dt id="example_group_6" class="passed">failing spec</dt>
341
+ <script type="text/javascript">makeRed('div_group_6');</script>
241
342
  <script type="text/javascript">makeRed('example_group_6');</script>
242
343
  <script type="text/javascript">moveProgressBar('71.4');</script>
243
- <dd class="spec failed">
344
+ <dd class="example failed">
244
345
  <span class="failed_spec_name">fails</span>
245
- <div class="failure" id="failure_0">
346
+ <div class="failure" id="failure_2">
246
347
  <div class="message"><pre>
247
348
  expected 2
248
349
  got 1
@@ -264,14 +365,15 @@ expected 2
264
365
  </dd>
265
366
  </dl>
266
367
  </div>
267
- <div class="example_group">
368
+ <div id="div_group_7" class="example_group passed">
268
369
  <dl style="margin-left: 0px;">
269
- <dt id="example_group_7">a failing spec with odd backtraces</dt>
370
+ <dt id="example_group_7" class="passed">a failing spec with odd backtraces</dt>
371
+ <script type="text/javascript">makeRed('div_group_7');</script>
270
372
  <script type="text/javascript">makeRed('example_group_7');</script>
271
373
  <script type="text/javascript">moveProgressBar('85.7');</script>
272
- <dd class="spec failed">
374
+ <dd class="example failed">
273
375
  <span class="failed_spec_name">fails with a backtrace that has no file</span>
274
- <div class="failure" id="failure_0">
376
+ <div class="failure" id="failure_3">
275
377
  <div class="message"><pre>foo</pre></div>
276
378
  <div class="backtrace"><pre>(erb):1:in `<main>'
277
379
  ./spec/rspec/core/resources/formatter_specs.rb:41:in `block (2 levels) in <top (required)>'
@@ -285,9 +387,9 @@ expected 2
285
387
  </div>
286
388
  </dd>
287
389
  <script type="text/javascript">moveProgressBar('100.0');</script>
288
- <dd class="spec failed">
390
+ <dd class="example failed">
289
391
  <span class="failed_spec_name">fails with a backtrace containing an erb file</span>
290
- <div class="failure" id="failure_0">
392
+ <div class="failure" id="failure_4">
291
393
  <div class="message"><pre>Exception</pre></div>
292
394
  <div class="backtrace"><pre>/foo.html.erb:1:in `<main>': foo (RuntimeError)</pre></div>
293
395
  <pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
@@ -18,24 +18,78 @@
18
18
  </style>
19
19
  <script type="text/javascript">
20
20
  // <![CDATA[
21
+
22
+ function addClass(element_id, classname) {
23
+ document.getElementById(element_id).className += (" " + classname);
24
+ }
25
+
26
+ function removeClass(element_id, classname) {
27
+ var elem = document.getElementById(element_id);
28
+ var classlist = elem.className.replace(classname,'');
29
+ elem.className = classlist;
30
+ }
31
+
21
32
  function moveProgressBar(percentDone) {
22
33
  document.getElementById("rspec-header").style.width = percentDone +"%";
23
34
  }
35
+
24
36
  function makeRed(element_id) {
25
- document.getElementById(element_id).style.background = '#C40D0D';
26
- document.getElementById(element_id).style.color = '#FFFFFF';
37
+ removeClass(element_id, 'passed');
38
+ removeClass(element_id, 'not_implemented');
39
+ addClass(element_id,'failed');
27
40
  }
28
41
 
29
42
  function makeYellow(element_id) {
30
- if (element_id == "rspec-header" && document.getElementById(element_id).style.background != '#C40D0D')
31
- {
32
- document.getElementById(element_id).style.background = '#FAF834';
33
- document.getElementById(element_id).style.color = '#000000';
43
+ var elem = document.getElementById(element_id);
44
+ if (elem.className.indexOf("failed") == -1) { // class doesn't includes failed
45
+ if (elem.className.indexOf("not_implemented") == -1) { // class doesn't include not_implemented
46
+ removeClass(element_id, 'passed');
47
+ addClass(element_id,'not_implemented');
48
+ }
34
49
  }
35
- else
36
- {
37
- document.getElementById(element_id).style.background = '#FAF834';
38
- document.getElementById(element_id).style.color = '#000000';
50
+ }
51
+
52
+ function apply_filters() {
53
+ var passed_filter = document.getElementById('passed_checkbox').checked;
54
+ var failed_filter = document.getElementById('failed_checkbox').checked;
55
+ var pending_filter = document.getElementById('pending_checkbox').checked;
56
+
57
+ assign_display_style("example passed", passed_filter);
58
+ assign_display_style("example failed", failed_filter);
59
+ assign_display_style("example not_implemented", pending_filter);
60
+
61
+ assign_display_style_for_group("example_group passed", passed_filter);
62
+ assign_display_style_for_group("example_group not_implemented", pending_filter, pending_filter || passed_filter);
63
+ assign_display_style_for_group("example_group failed", failed_filter, failed_filter || pending_filter || passed_filter);
64
+ }
65
+
66
+ function get_display_style(display_flag) {
67
+ var style_mode = 'none';
68
+ if (display_flag == true) {
69
+ style_mode = 'block';
70
+ }
71
+ return style_mode;
72
+ }
73
+
74
+ function assign_display_style(classname, display_flag) {
75
+ var style_mode = get_display_style(display_flag);
76
+ var elems = document.getElementsByClassName(classname)
77
+ for (var i=0; i<elems.length;i++) {
78
+ elems[i].style.display = style_mode;
79
+ }
80
+ }
81
+
82
+ function assign_display_style_for_group(classname, display_flag, subgroup_flag) {
83
+ var display_style_mode = get_display_style(display_flag);
84
+ var subgroup_style_mode = get_display_style(subgroup_flag);
85
+ var elems = document.getElementsByClassName(classname)
86
+ for (var i=0; i<elems.length;i++) {
87
+ var style_mode = display_style_mode;
88
+ if ((display_flag != subgroup_flag) && (elems[i].getElementsByTagName('dt')[0].innerHTML.indexOf(", ") != -1)) {
89
+ elems[i].style.display = subgroup_style_mode;
90
+ } else {
91
+ elems[i].style.display = display_style_mode;
92
+ }
39
93
  }
40
94
  }
41
95
 
@@ -54,13 +108,21 @@ function makeYellow(element_id) {
54
108
  position: absolute;
55
109
  }
56
110
 
111
+ #label {
112
+ float:left;
113
+ }
114
+
115
+ #display-filters {
116
+ float:left;
117
+ padding: 28px 0 0 40%;
118
+ font-family: "Lucida Grande", Helvetica, sans-serif;
119
+ }
120
+
57
121
  #summary {
58
- margin: 0; padding: 5px 10px;
122
+ float:right;
123
+ padding: 5px 10px;
59
124
  font-family: "Lucida Grande", Helvetica, sans-serif;
60
125
  text-align: right;
61
- top: 0px;
62
- right: 0px;
63
- float:right;
64
126
  }
65
127
 
66
128
  #summary p {
@@ -93,30 +155,58 @@ dd {
93
155
  padding: 3px 3px 3px 18px;
94
156
  }
95
157
 
96
- dd.spec.passed {
158
+
159
+ dd.example.passed {
97
160
  border-left: 5px solid #65C400;
98
161
  border-bottom: 1px solid #65C400;
99
162
  background: #DBFFB4; color: #3D7700;
100
163
  }
101
164
 
102
- dd.spec.failed {
103
- border-left: 5px solid #C20000;
104
- border-bottom: 1px solid #C20000;
105
- color: #C20000; background: #FFFBD3;
106
- }
107
-
108
- dd.spec.not_implemented {
165
+ dd.example.not_implemented {
109
166
  border-left: 5px solid #FAF834;
110
167
  border-bottom: 1px solid #FAF834;
111
168
  background: #FCFB98; color: #131313;
112
169
  }
113
170
 
114
- dd.spec.pending_fixed {
171
+ dd.example.pending_fixed {
115
172
  border-left: 5px solid #0000C2;
116
173
  border-bottom: 1px solid #0000C2;
117
174
  color: #0000C2; background: #D3FBFF;
118
175
  }
119
176
 
177
+ dd.example.failed {
178
+ border-left: 5px solid #C20000;
179
+ border-bottom: 1px solid #C20000;
180
+ color: #C20000; background: #FFFBD3;
181
+ }
182
+
183
+
184
+ dt.not_implemented {
185
+ color: #000000; background: #FAF834;
186
+ }
187
+
188
+ dt.pending_fixed {
189
+ color: #FFFFFF; background: #C40D0D;
190
+ }
191
+
192
+ dt.failed {
193
+ color: #FFFFFF; background: #C40D0D;
194
+ }
195
+
196
+
197
+ #rspec-header.not_implemented {
198
+ color: #000000; background: #FAF834;
199
+ }
200
+
201
+ #rspec-header.pending_fixed {
202
+ color: #FFFFFF; background: #C40D0D;
203
+ }
204
+
205
+ #rspec-header.failed {
206
+ color: #FFFFFF; background: #C40D0D;
207
+ }
208
+
209
+
120
210
  .backtrace {
121
211
  color: #000;
122
212
  font-size: 12px;
@@ -172,45 +262,55 @@ a {
172
262
  <h1>RSpec Code Examples</h1>
173
263
  </div>
174
264
 
265
+ <div id="display-filters">
266
+ <input id="passed_checkbox" name="passed_checkbox" type="checkbox" checked onchange="apply_filters()" value="1"> <label for="passed_checkbox">Passed</label>
267
+ <input id="failed_checkbox" name="failed_checkbox" type="checkbox" checked onchange="apply_filters()" value="2"> <label for="failed_checkbox">Failed</label>
268
+ <input id="pending_checkbox" name="pending_checkbox" type="checkbox" checked onchange="apply_filters()" value="3"> <label for="pending_checkbox">Pending</label>
269
+ </div>
270
+
175
271
  <div id="summary">
176
272
  <p id="totals">&nbsp;</p>
177
273
  <p id="duration">&nbsp;</p>
178
274
  </div>
179
275
  </div>
180
276
 
277
+
181
278
  <div class="results">
182
- <div class="example_group">
279
+ <div id="div_group_1" class="example_group passed">
183
280
  <dl style="margin-left: 0px;">
184
- <dt id="example_group_1">pending spec with no implementation</dt>
281
+ <dt id="example_group_1" class="passed">pending spec with no implementation</dt>
185
282
  <script type="text/javascript">makeYellow('rspec-header');</script>
283
+ <script type="text/javascript">makeYellow('div_group_1');</script>
186
284
  <script type="text/javascript">makeYellow('example_group_1');</script>
187
285
  <script type="text/javascript">moveProgressBar('14.2');</script>
188
- <dd class="spec not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: Not Yet Implemented)</span></dd>
286
+ <dd class="example not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: Not Yet Implemented)</span></dd>
189
287
  </dl>
190
288
  </div>
191
- <div class="example_group">
289
+ <div id="div_group_2" class="example_group passed">
192
290
  <dl style="margin-left: 0px;">
193
- <dt id="example_group_2">pending command with block format</dt>
291
+ <dt id="example_group_2" class="passed">pending command with block format</dt>
194
292
  </dl>
195
293
  </div>
196
- <div class="example_group">
294
+ <div id="div_group_3" class="example_group passed">
197
295
  <dl style="margin-left: 15px;">
198
- <dt id="example_group_3">with content that would fail</dt>
296
+ <dt id="example_group_3" class="passed">with content that would fail</dt>
199
297
  <script type="text/javascript">makeYellow('rspec-header');</script>
298
+ <script type="text/javascript">makeYellow('div_group_3');</script>
200
299
  <script type="text/javascript">makeYellow('example_group_3');</script>
201
300
  <script type="text/javascript">moveProgressBar('28.5');</script>
202
- <dd class="spec not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: No reason given)</span></dd>
301
+ <dd class="example not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: No reason given)</span></dd>
203
302
  </dl>
204
303
  </div>
205
- <div class="example_group">
304
+ <div id="div_group_4" class="example_group passed">
206
305
  <dl style="margin-left: 15px;">
207
- <dt id="example_group_4">with content that would pass</dt>
306
+ <dt id="example_group_4" class="passed">with content that would pass</dt>
208
307
  <script type="text/javascript">makeRed('rspec-header');</script>
308
+ <script type="text/javascript">makeRed('div_group_4');</script>
209
309
  <script type="text/javascript">makeRed('example_group_4');</script>
210
310
  <script type="text/javascript">moveProgressBar('42.8');</script>
211
- <dd class="spec pending_fixed">
311
+ <dd class="example pending_fixed">
212
312
  <span class="failed_spec_name">fails</span>
213
- <div class="failure" id="failure_0">
313
+ <div class="failure" id="failure_1">
214
314
  <div class="message"><pre>RSpec::Core::PendingExampleFixedError</pre></div>
215
315
  <div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/resources/formatter_specs.rb&line=18">./spec/rspec/core/resources/formatter_specs.rb:18</a>
216
316
  <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=24">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:24</a>
@@ -228,21 +328,22 @@ a {
228
328
  </dd>
229
329
  </dl>
230
330
  </div>
231
- <div class="example_group">
331
+ <div id="div_group_5" class="example_group passed">
232
332
  <dl style="margin-left: 0px;">
233
- <dt id="example_group_5">passing spec</dt>
333
+ <dt id="example_group_5" class="passed">passing spec</dt>
234
334
  <script type="text/javascript">moveProgressBar('57.1');</script>
235
- <dd class="spec passed"><span class="passed_spec_name">passes</span></dd>
335
+ <dd class="example passed"><span class="passed_spec_name">passes</span></dd>
236
336
  </dl>
237
337
  </div>
238
- <div class="example_group">
338
+ <div id="div_group_6" class="example_group passed">
239
339
  <dl style="margin-left: 0px;">
240
- <dt id="example_group_6">failing spec</dt>
340
+ <dt id="example_group_6" class="passed">failing spec</dt>
341
+ <script type="text/javascript">makeRed('div_group_6');</script>
241
342
  <script type="text/javascript">makeRed('example_group_6');</script>
242
343
  <script type="text/javascript">moveProgressBar('71.4');</script>
243
- <dd class="spec failed">
344
+ <dd class="example failed">
244
345
  <span class="failed_spec_name">fails</span>
245
- <div class="failure" id="failure_0">
346
+ <div class="failure" id="failure_2">
246
347
  <div class="message"><pre>
247
348
  expected 2
248
349
  got 1
@@ -264,23 +365,24 @@ expected 2
264
365
  </dd>
265
366
  </dl>
266
367
  </div>
267
- <div class="example_group">
368
+ <div id="div_group_7" class="example_group passed">
268
369
  <dl style="margin-left: 0px;">
269
- <dt id="example_group_7">a failing spec with odd backtraces</dt>
370
+ <dt id="example_group_7" class="passed">a failing spec with odd backtraces</dt>
371
+ <script type="text/javascript">makeRed('div_group_7');</script>
270
372
  <script type="text/javascript">makeRed('example_group_7');</script>
271
373
  <script type="text/javascript">moveProgressBar('85.7');</script>
272
- <dd class="spec failed">
374
+ <dd class="example failed">
273
375
  <span class="failed_spec_name">fails with a backtrace that has no file</span>
274
- <div class="failure" id="failure_0">
376
+ <div class="failure" id="failure_3">
275
377
  <div class="message"><pre>foo</pre></div>
276
378
  <div class="backtrace"><pre>(erb):1</pre></div>
277
379
  <pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for (erb)</span></code></pre>
278
380
  </div>
279
381
  </dd>
280
382
  <script type="text/javascript">moveProgressBar('100.0');</script>
281
- <dd class="spec failed">
383
+ <dd class="example failed">
282
384
  <span class="failed_spec_name">fails with a backtrace containing an erb file</span>
283
- <div class="failure" id="failure_0">
385
+ <div class="failure" id="failure_4">
284
386
  <div class="message"><pre>Exception</pre></div>
285
387
  <div class="backtrace"><pre><a href="txmt://open?url=file:///foo.html.erb&line=1">/foo.html.erb:1</a> :in `<main>': foo (RuntimeError)</pre></div>
286
388
  <pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>