rspec-core 2.6.4 → 2.7.0.rc1

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.md +1 -1
  2. data/{bin → exe}/autospec +0 -0
  3. data/{bin → exe}/rspec +0 -0
  4. data/features/Upgrade.md +11 -0
  5. data/features/command_line/exit_status.feature +20 -3
  6. data/features/command_line/format_option.feature +8 -0
  7. data/features/command_line/line_number_appended_to_path.feature +35 -1
  8. data/features/command_line/line_number_option.feature +16 -3
  9. data/features/command_line/pattern_option.feature +31 -0
  10. data/features/command_line/rake_task.feature +1 -1
  11. data/features/command_line/ruby.feature +22 -0
  12. data/features/configuration/default_path.feature +38 -0
  13. data/features/example_groups/{shared_example_group.feature → shared_examples.feature} +49 -26
  14. data/features/expectation_framework_integration/configure_expectation_framework.feature +1 -1
  15. data/features/filtering/inclusion_filters.feature +4 -5
  16. data/features/formatters/text_formatter.feature +16 -13
  17. data/features/helper_methods/let.feature +4 -4
  18. data/features/hooks/around_hooks.feature +1 -1
  19. data/features/hooks/before_and_after_hooks.feature +3 -3
  20. data/features/hooks/filtering.feature +13 -6
  21. data/features/metadata/user_defined.feature +12 -10
  22. data/features/pending/pending_examples.feature +21 -8
  23. data/features/step_definitions/additional_cli_steps.rb +1 -1
  24. data/features/subject/attribute_of_subject.feature +2 -2
  25. data/features/support/env.rb +1 -2
  26. data/lib/rspec/core.rb +1 -23
  27. data/lib/rspec/core/configuration.rb +64 -16
  28. data/lib/rspec/core/configuration_options.rb +11 -4
  29. data/lib/rspec/core/example.rb +10 -7
  30. data/lib/rspec/core/example_group.rb +34 -18
  31. data/lib/rspec/core/formatters/base_text_formatter.rb +10 -2
  32. data/lib/rspec/core/formatters/html_formatter.rb +3 -1
  33. data/lib/rspec/core/formatters/snippet_extractor.rb +9 -3
  34. data/lib/rspec/core/formatters/text_mate_formatter.rb +20 -6
  35. data/lib/rspec/core/hooks.rb +2 -2
  36. data/lib/rspec/core/let.rb +5 -5
  37. data/lib/rspec/core/metadata.rb +136 -94
  38. data/lib/rspec/core/option_parser.rb +10 -5
  39. data/lib/rspec/core/pending.rb +2 -1
  40. data/lib/rspec/core/rake_task.rb +26 -15
  41. data/lib/rspec/core/reporter.rb +2 -3
  42. data/lib/rspec/core/runner.rb +1 -1
  43. data/lib/rspec/core/shared_example_group.rb +4 -4
  44. data/lib/rspec/core/subject.rb +7 -7
  45. data/lib/rspec/core/version.rb +1 -1
  46. data/lib/rspec/core/world.rb +4 -8
  47. data/spec/autotest/discover_spec.rb +2 -2
  48. data/spec/autotest/failed_results_re_spec.rb +29 -21
  49. data/spec/autotest/rspec_spec.rb +3 -3
  50. data/spec/rspec/core/command_line_spec.rb +1 -6
  51. data/spec/rspec/core/configuration_options_spec.rb +65 -13
  52. data/spec/rspec/core/configuration_spec.rb +148 -37
  53. data/spec/rspec/core/deprecations_spec.rb +2 -2
  54. data/spec/rspec/core/drb_command_line_spec.rb +6 -6
  55. data/spec/rspec/core/example_group_spec.rb +197 -61
  56. data/spec/rspec/core/example_spec.rb +33 -16
  57. data/spec/rspec/core/formatters/base_formatter_spec.rb +3 -3
  58. data/spec/rspec/core/formatters/base_text_formatter_spec.rb +149 -1
  59. data/spec/rspec/core/formatters/helpers_spec.rb +8 -8
  60. data/spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html +85 -17
  61. data/spec/rspec/core/formatters/html_formatted-1.8.7.html +12 -11
  62. data/spec/rspec/core/formatters/html_formatted-1.9.2.html +12 -11
  63. data/spec/rspec/core/formatters/{html_formatted-1.9.1.html → html_formatted-1.9.3.html} +12 -11
  64. data/spec/rspec/core/formatters/html_formatter_spec.rb +5 -5
  65. data/spec/rspec/core/formatters/progress_formatter_spec.rb +2 -2
  66. data/spec/rspec/core/formatters/snippet_extractor_spec.rb +2 -2
  67. data/spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html +86 -18
  68. data/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +13 -12
  69. data/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +29 -28
  70. data/spec/rspec/core/formatters/{text_mate_formatted-1.9.1.html → text_mate_formatted-1.9.3.html} +29 -28
  71. data/spec/rspec/core/formatters/text_mate_formatter_spec.rb +2 -2
  72. data/spec/rspec/core/hooks_filtering_spec.rb +18 -18
  73. data/spec/rspec/core/let_spec.rb +19 -6
  74. data/spec/rspec/core/metadata_spec.rb +146 -61
  75. data/spec/rspec/core/pending_example_spec.rb +4 -4
  76. data/spec/rspec/core/rake_task_spec.rb +71 -50
  77. data/spec/rspec/core/reporter_spec.rb +2 -2
  78. data/spec/rspec/core/ruby_project_spec.rb +2 -2
  79. data/spec/rspec/core/runner_spec.rb +4 -1
  80. data/spec/rspec/core/shared_example_group_spec.rb +15 -119
  81. data/spec/rspec/core/subject_spec.rb +13 -13
  82. data/spec/rspec/core/world_spec.rb +31 -22
  83. data/spec/rspec/core_spec.rb +1 -29
  84. data/spec/spec_helper.rb +51 -49
  85. data/spec/support/shared_example_groups.rb +3 -3
  86. data/spec/support/spec_files.rb +8 -8
  87. metadata +79 -93
  88. data/.document +0 -5
  89. data/.gitignore +0 -12
  90. data/.rspec +0 -0
  91. data/.travis.yml +0 -9
  92. data/Changelog.md +0 -305
  93. data/Gemfile +0 -49
  94. data/Guardfile +0 -5
  95. data/License.txt +0 -23
  96. data/Rakefile +0 -93
  97. data/cucumber.yml +0 -2
  98. data/features/.nav +0 -57
  99. data/rspec-core.gemspec +0 -24
  100. data/script/FullBuildRakeFile +0 -63
  101. data/script/console +0 -8
  102. data/script/cucumber +0 -1
  103. data/script/full_build +0 -1
  104. data/script/spec +0 -1
  105. data/spec.txt +0 -1126
  106. data/spec/rspec/core/formatters/html_formatted-1.8.6.html +0 -398
  107. data/spec/rspec/core/formatters/text_mate_formatted-1.8.6.html +0 -398
@@ -1,398 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
- <head>
7
- <title>RSpec results</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
- <meta http-equiv="Expires" content="-1" />
10
- <meta http-equiv="Pragma" content="no-cache" />
11
- <style type="text/css">
12
- body {
13
- margin: 0;
14
- padding: 0;
15
- background: #fff;
16
- font-size: 80%;
17
- }
18
- </style>
19
- <script type="text/javascript">
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
-
32
- function moveProgressBar(percentDone) {
33
- document.getElementById("rspec-header").style.width = percentDone +"%";
34
- }
35
-
36
- function makeRed(element_id) {
37
- removeClass(element_id, 'passed');
38
- removeClass(element_id, 'not_implemented');
39
- addClass(element_id,'failed');
40
- }
41
-
42
- function makeYellow(element_id) {
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
- }
49
- }
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
- }
93
- }
94
- }
95
-
96
- // ]]>
97
- </script>
98
- <style type="text/css">
99
- #rspec-header {
100
- background: #65C400; color: #fff; height: 4em;
101
- }
102
-
103
- .rspec-report h1 {
104
- margin: 0px 10px 0px 10px;
105
- padding: 10px;
106
- font-family: "Lucida Grande", Helvetica, sans-serif;
107
- font-size: 1.8em;
108
- position: absolute;
109
- }
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
-
121
- #summary {
122
- float:right;
123
- padding: 5px 10px;
124
- font-family: "Lucida Grande", Helvetica, sans-serif;
125
- text-align: right;
126
- }
127
-
128
- #summary p {
129
- margin: 0 0 0 2px;
130
- }
131
-
132
- #summary #totals {
133
- font-size: 1.2em;
134
- }
135
-
136
- .example_group {
137
- margin: 0 10px 5px;
138
- background: #fff;
139
- }
140
-
141
- dl {
142
- margin: 0; padding: 0 0 5px;
143
- font: normal 11px "Lucida Grande", Helvetica, sans-serif;
144
- }
145
-
146
- dt {
147
- padding: 3px;
148
- background: #65C400;
149
- color: #fff;
150
- font-weight: bold;
151
- }
152
-
153
- dd {
154
- margin: 5px 0 5px 5px;
155
- padding: 3px 3px 3px 18px;
156
- }
157
-
158
-
159
- dd.example.passed {
160
- border-left: 5px solid #65C400;
161
- border-bottom: 1px solid #65C400;
162
- background: #DBFFB4; color: #3D7700;
163
- }
164
-
165
- dd.example.not_implemented {
166
- border-left: 5px solid #FAF834;
167
- border-bottom: 1px solid #FAF834;
168
- background: #FCFB98; color: #131313;
169
- }
170
-
171
- dd.example.pending_fixed {
172
- border-left: 5px solid #0000C2;
173
- border-bottom: 1px solid #0000C2;
174
- color: #0000C2; background: #D3FBFF;
175
- }
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
-
210
- .backtrace {
211
- color: #000;
212
- font-size: 12px;
213
- }
214
-
215
- a {
216
- color: #BE5C00;
217
- }
218
-
219
- /* Ruby code, style similar to vibrant ink */
220
- .ruby {
221
- font-size: 12px;
222
- font-family: monospace;
223
- color: white;
224
- background-color: black;
225
- padding: 0.1em 0 0.2em 0;
226
- }
227
-
228
- .ruby .keyword { color: #FF6600; }
229
- .ruby .constant { color: #339999; }
230
- .ruby .attribute { color: white; }
231
- .ruby .global { color: white; }
232
- .ruby .module { color: white; }
233
- .ruby .class { color: white; }
234
- .ruby .string { color: #66FF00; }
235
- .ruby .ident { color: white; }
236
- .ruby .method { color: #FFCC00; }
237
- .ruby .number { color: white; }
238
- .ruby .char { color: white; }
239
- .ruby .comment { color: #9933CC; }
240
- .ruby .symbol { color: white; }
241
- .ruby .regex { color: #44B4CC; }
242
- .ruby .punct { color: white; }
243
- .ruby .escape { color: white; }
244
- .ruby .interp { color: white; }
245
- .ruby .expr { color: white; }
246
-
247
- .ruby .offending { background-color: gray; }
248
- .ruby .linenum {
249
- width: 75px;
250
- padding: 0.1em 1em 0.2em 0;
251
- color: #000000;
252
- background-color: #FFFBD3;
253
- }
254
-
255
- </style>
256
- </head>
257
- <body>
258
- <div class="rspec-report">
259
-
260
- <div id="rspec-header">
261
- <div id="label">
262
- <h1>RSpec Code Examples</h1>
263
- </div>
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
-
271
- <div id="summary">
272
- <p id="totals">&nbsp;</p>
273
- <p id="duration">&nbsp;</p>
274
- </div>
275
- </div>
276
-
277
-
278
- <div class="results">
279
- <div id="div_group_1" class="example_group passed">
280
- <dl style="margin-left: 0px;">
281
- <dt id="example_group_1" class="passed">pending spec with no implementation</dt>
282
- <script type="text/javascript">makeYellow('rspec-header');</script>
283
- <script type="text/javascript">makeYellow('div_group_1');</script>
284
- <script type="text/javascript">makeYellow('example_group_1');</script>
285
- <script type="text/javascript">moveProgressBar('14.2');</script>
286
- <dd class="example not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: Not Yet Implemented)</span></dd>
287
- </dl>
288
- </div>
289
- <div id="div_group_2" class="example_group passed">
290
- <dl style="margin-left: 0px;">
291
- <dt id="example_group_2" class="passed">pending command with block format</dt>
292
- </dl>
293
- </div>
294
- <div id="div_group_3" class="example_group passed">
295
- <dl style="margin-left: 15px;">
296
- <dt id="example_group_3" class="passed">with content that would fail</dt>
297
- <script type="text/javascript">makeYellow('rspec-header');</script>
298
- <script type="text/javascript">makeYellow('div_group_3');</script>
299
- <script type="text/javascript">makeYellow('example_group_3');</script>
300
- <script type="text/javascript">moveProgressBar('28.5');</script>
301
- <dd class="example not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: No reason given)</span></dd>
302
- </dl>
303
- </div>
304
- <div id="div_group_4" class="example_group passed">
305
- <dl style="margin-left: 15px;">
306
- <dt id="example_group_4" class="passed">with content that would pass</dt>
307
- <script type="text/javascript">makeRed('rspec-header');</script>
308
- <script type="text/javascript">makeRed('div_group_4');</script>
309
- <script type="text/javascript">makeRed('example_group_4');</script>
310
- <script type="text/javascript">moveProgressBar('42.8');</script>
311
- <dd class="example pending_fixed">
312
- <span class="failed_spec_name">fails</span>
313
- <div class="failure" id="failure_1">
314
- <div class="message"><pre>RSpec::Core::PendingExampleFixedError</pre></div>
315
- <div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:18
316
- ./spec/rspec/core/formatters/html_formatter_spec.rb:24
317
- ./spec/rspec/core/formatters/html_formatter_spec.rb:46
318
- ./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `open'
319
- ./spec/rspec/core/formatters/html_formatter_spec.rb:46
320
- ./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `chdir'
321
- ./spec/rspec/core/formatters/html_formatter_spec.rb:45</pre></div>
322
- <pre class="ruby"><code><span class="linenum">29</span> <span class="ident">teardown_mocks_for_rspec</span>
323
- <span class="linenum">30</span> <span class="keyword">end</span>
324
- <span class="offending"><span class="linenum">31</span> <span class="keyword">raise</span> <span class="constant">RSpec</span><span class="punct">::</span><span class="constant">Core</span><span class="punct">::</span><span class="constant">PendingExampleFixedError</span><span class="punct">.</span><span class="ident">new</span> <span class="keyword">if</span> <span class="ident">result</span></span>
325
- <span class="linenum">32</span> <span class="keyword">end</span>
326
- <span class="linenum">33</span> <span class="keyword">raise</span> <span class="constant">PendingDeclaredInExample</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(</span><span class="ident">message</span><span class="punct">)</span></code></pre>
327
- </div>
328
- </dd>
329
- </dl>
330
- </div>
331
- <div id="div_group_5" class="example_group passed">
332
- <dl style="margin-left: 0px;">
333
- <dt id="example_group_5" class="passed">passing spec</dt>
334
- <script type="text/javascript">moveProgressBar('57.1');</script>
335
- <dd class="example passed"><span class="passed_spec_name">passes</span></dd>
336
- </dl>
337
- </div>
338
- <div id="div_group_6" class="example_group passed">
339
- <dl style="margin-left: 0px;">
340
- <dt id="example_group_6" class="passed">failing spec</dt>
341
- <script type="text/javascript">makeRed('div_group_6');</script>
342
- <script type="text/javascript">makeRed('example_group_6');</script>
343
- <script type="text/javascript">moveProgressBar('71.4');</script>
344
- <dd class="example failed">
345
- <span class="failed_spec_name">fails</span>
346
- <div class="failure" id="failure_2">
347
- <div class="message"><pre>
348
- expected 2
349
- got 1
350
-
351
- (compared using ==)
352
- </pre></div>
353
- <div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:33
354
- ./spec/rspec/core/formatters/html_formatter_spec.rb:24
355
- ./spec/rspec/core/formatters/html_formatter_spec.rb:46
356
- ./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `open'
357
- ./spec/rspec/core/formatters/html_formatter_spec.rb:46
358
- ./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `chdir'
359
- ./spec/rspec/core/formatters/html_formatter_spec.rb:45</pre></div>
360
- <pre class="ruby"><code><span class="linenum">27</span> <span class="keyword">end</span>
361
- <span class="linenum">28</span>
362
- <span class="offending"><span class="linenum">29</span> <span class="keyword">raise</span><span class="punct">(</span><span class="constant">RSpec</span><span class="punct">::</span><span class="constant">Expectations</span><span class="punct">::</span><span class="constant">ExpectationNotMetError</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(</span><span class="ident">message</span><span class="punct">))</span></span>
363
- <span class="linenum">30</span> <span class="keyword">end</span></code></pre>
364
- </div>
365
- </dd>
366
- </dl>
367
- </div>
368
- <div id="div_group_7" class="example_group passed">
369
- <dl style="margin-left: 0px;">
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>
372
- <script type="text/javascript">makeRed('example_group_7');</script>
373
- <script type="text/javascript">moveProgressBar('85.7');</script>
374
- <dd class="example failed">
375
- <span class="failed_spec_name">fails with a backtrace that has no file</span>
376
- <div class="failure" id="failure_3">
377
- <div class="message"><pre>foo</pre></div>
378
- <div class="backtrace"><pre>(erb):1</pre></div>
379
- <pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for (erb)</span></code></pre>
380
- </div>
381
- </dd>
382
- <script type="text/javascript">moveProgressBar('100.0');</script>
383
- <dd class="example failed">
384
- <span class="failed_spec_name">fails with a backtrace containing an erb file</span>
385
- <div class="failure" id="failure_4">
386
- <div class="message"><pre>Exception</pre></div>
387
- <div class="backtrace"><pre>/foo.html.erb:1:in `<main>': foo (RuntimeError)</pre></div>
388
- <pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
389
- </div>
390
- </dd>
391
- </dl>
392
- </div>
393
- <script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>x seconds</strong>";</script>
394
- <script type="text/javascript">document.getElementById('totals').innerHTML = "7 examples, 4 failures, 2 pending";</script>
395
- </div>
396
- </div>
397
- </body>
398
- </html>
@@ -1,398 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
- <head>
7
- <title>RSpec results</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
- <meta http-equiv="Expires" content="-1" />
10
- <meta http-equiv="Pragma" content="no-cache" />
11
- <style type="text/css">
12
- body {
13
- margin: 0;
14
- padding: 0;
15
- background: #fff;
16
- font-size: 80%;
17
- }
18
- </style>
19
- <script type="text/javascript">
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
-
32
- function moveProgressBar(percentDone) {
33
- document.getElementById("rspec-header").style.width = percentDone +"%";
34
- }
35
-
36
- function makeRed(element_id) {
37
- removeClass(element_id, 'passed');
38
- removeClass(element_id, 'not_implemented');
39
- addClass(element_id,'failed');
40
- }
41
-
42
- function makeYellow(element_id) {
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
- }
49
- }
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
- }
93
- }
94
- }
95
-
96
- // ]]>
97
- </script>
98
- <style type="text/css">
99
- #rspec-header {
100
- background: #65C400; color: #fff; height: 4em;
101
- }
102
-
103
- .rspec-report h1 {
104
- margin: 0px 10px 0px 10px;
105
- padding: 10px;
106
- font-family: "Lucida Grande", Helvetica, sans-serif;
107
- font-size: 1.8em;
108
- position: absolute;
109
- }
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
-
121
- #summary {
122
- float:right;
123
- padding: 5px 10px;
124
- font-family: "Lucida Grande", Helvetica, sans-serif;
125
- text-align: right;
126
- }
127
-
128
- #summary p {
129
- margin: 0 0 0 2px;
130
- }
131
-
132
- #summary #totals {
133
- font-size: 1.2em;
134
- }
135
-
136
- .example_group {
137
- margin: 0 10px 5px;
138
- background: #fff;
139
- }
140
-
141
- dl {
142
- margin: 0; padding: 0 0 5px;
143
- font: normal 11px "Lucida Grande", Helvetica, sans-serif;
144
- }
145
-
146
- dt {
147
- padding: 3px;
148
- background: #65C400;
149
- color: #fff;
150
- font-weight: bold;
151
- }
152
-
153
- dd {
154
- margin: 5px 0 5px 5px;
155
- padding: 3px 3px 3px 18px;
156
- }
157
-
158
-
159
- dd.example.passed {
160
- border-left: 5px solid #65C400;
161
- border-bottom: 1px solid #65C400;
162
- background: #DBFFB4; color: #3D7700;
163
- }
164
-
165
- dd.example.not_implemented {
166
- border-left: 5px solid #FAF834;
167
- border-bottom: 1px solid #FAF834;
168
- background: #FCFB98; color: #131313;
169
- }
170
-
171
- dd.example.pending_fixed {
172
- border-left: 5px solid #0000C2;
173
- border-bottom: 1px solid #0000C2;
174
- color: #0000C2; background: #D3FBFF;
175
- }
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
-
210
- .backtrace {
211
- color: #000;
212
- font-size: 12px;
213
- }
214
-
215
- a {
216
- color: #BE5C00;
217
- }
218
-
219
- /* Ruby code, style similar to vibrant ink */
220
- .ruby {
221
- font-size: 12px;
222
- font-family: monospace;
223
- color: white;
224
- background-color: black;
225
- padding: 0.1em 0 0.2em 0;
226
- }
227
-
228
- .ruby .keyword { color: #FF6600; }
229
- .ruby .constant { color: #339999; }
230
- .ruby .attribute { color: white; }
231
- .ruby .global { color: white; }
232
- .ruby .module { color: white; }
233
- .ruby .class { color: white; }
234
- .ruby .string { color: #66FF00; }
235
- .ruby .ident { color: white; }
236
- .ruby .method { color: #FFCC00; }
237
- .ruby .number { color: white; }
238
- .ruby .char { color: white; }
239
- .ruby .comment { color: #9933CC; }
240
- .ruby .symbol { color: white; }
241
- .ruby .regex { color: #44B4CC; }
242
- .ruby .punct { color: white; }
243
- .ruby .escape { color: white; }
244
- .ruby .interp { color: white; }
245
- .ruby .expr { color: white; }
246
-
247
- .ruby .offending { background-color: gray; }
248
- .ruby .linenum {
249
- width: 75px;
250
- padding: 0.1em 1em 0.2em 0;
251
- color: #000000;
252
- background-color: #FFFBD3;
253
- }
254
-
255
- </style>
256
- </head>
257
- <body>
258
- <div class="rspec-report">
259
-
260
- <div id="rspec-header">
261
- <div id="label">
262
- <h1>RSpec Code Examples</h1>
263
- </div>
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
-
271
- <div id="summary">
272
- <p id="totals">&nbsp;</p>
273
- <p id="duration">&nbsp;</p>
274
- </div>
275
- </div>
276
-
277
-
278
- <div class="results">
279
- <div id="div_group_1" class="example_group passed">
280
- <dl style="margin-left: 0px;">
281
- <dt id="example_group_1" class="passed">pending spec with no implementation</dt>
282
- <script type="text/javascript">makeYellow('rspec-header');</script>
283
- <script type="text/javascript">makeYellow('div_group_1');</script>
284
- <script type="text/javascript">makeYellow('example_group_1');</script>
285
- <script type="text/javascript">moveProgressBar('14.2');</script>
286
- <dd class="example not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: Not Yet Implemented)</span></dd>
287
- </dl>
288
- </div>
289
- <div id="div_group_2" class="example_group passed">
290
- <dl style="margin-left: 0px;">
291
- <dt id="example_group_2" class="passed">pending command with block format</dt>
292
- </dl>
293
- </div>
294
- <div id="div_group_3" class="example_group passed">
295
- <dl style="margin-left: 15px;">
296
- <dt id="example_group_3" class="passed">with content that would fail</dt>
297
- <script type="text/javascript">makeYellow('rspec-header');</script>
298
- <script type="text/javascript">makeYellow('div_group_3');</script>
299
- <script type="text/javascript">makeYellow('example_group_3');</script>
300
- <script type="text/javascript">moveProgressBar('28.5');</script>
301
- <dd class="example not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: No reason given)</span></dd>
302
- </dl>
303
- </div>
304
- <div id="div_group_4" class="example_group passed">
305
- <dl style="margin-left: 15px;">
306
- <dt id="example_group_4" class="passed">with content that would pass</dt>
307
- <script type="text/javascript">makeRed('rspec-header');</script>
308
- <script type="text/javascript">makeRed('div_group_4');</script>
309
- <script type="text/javascript">makeRed('example_group_4');</script>
310
- <script type="text/javascript">moveProgressBar('42.8');</script>
311
- <dd class="example pending_fixed">
312
- <span class="failed_spec_name">fails</span>
313
- <div class="failure" id="failure_1">
314
- <div class="message"><pre>RSpec::Core::PendingExampleFixedError</pre></div>
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>
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>
317
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=47">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:47</a>
318
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=47">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:47</a> :in `open'
319
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=47">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:47</a>
320
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=46">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:46</a> :in `chdir'
321
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=46">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:46</a> </pre></div>
322
- <pre class="ruby"><code><span class="linenum">29</span> <span class="ident">teardown_mocks_for_rspec</span>
323
- <span class="linenum">30</span> <span class="keyword">end</span>
324
- <span class="offending"><span class="linenum">31</span> <span class="keyword">raise</span> <span class="constant">RSpec</span><span class="punct">::</span><span class="constant">Core</span><span class="punct">::</span><span class="constant">PendingExampleFixedError</span><span class="punct">.</span><span class="ident">new</span> <span class="keyword">if</span> <span class="ident">result</span></span>
325
- <span class="linenum">32</span> <span class="keyword">end</span>
326
- <span class="linenum">33</span> <span class="keyword">raise</span> <span class="constant">PendingDeclaredInExample</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(</span><span class="ident">message</span><span class="punct">)</span></code></pre>
327
- </div>
328
- </dd>
329
- </dl>
330
- </div>
331
- <div id="div_group_5" class="example_group passed">
332
- <dl style="margin-left: 0px;">
333
- <dt id="example_group_5" class="passed">passing spec</dt>
334
- <script type="text/javascript">moveProgressBar('57.1');</script>
335
- <dd class="example passed"><span class="passed_spec_name">passes</span></dd>
336
- </dl>
337
- </div>
338
- <div id="div_group_6" class="example_group passed">
339
- <dl style="margin-left: 0px;">
340
- <dt id="example_group_6" class="passed">failing spec</dt>
341
- <script type="text/javascript">makeRed('div_group_6');</script>
342
- <script type="text/javascript">makeRed('example_group_6');</script>
343
- <script type="text/javascript">moveProgressBar('71.4');</script>
344
- <dd class="example failed">
345
- <span class="failed_spec_name">fails</span>
346
- <div class="failure" id="failure_2">
347
- <div class="message"><pre>
348
- expected 2
349
- got 1
350
-
351
- (compared using ==)
352
- </pre></div>
353
- <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=33">./spec/rspec/core/resources/formatter_specs.rb:33</a>
354
- <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>
355
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=47">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:47</a>
356
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=47">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:47</a> :in `open'
357
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=47">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:47</a>
358
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=46">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:46</a> :in `chdir'
359
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=46">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:46</a> </pre></div>
360
- <pre class="ruby"><code><span class="linenum">27</span> <span class="keyword">end</span>
361
- <span class="linenum">28</span>
362
- <span class="offending"><span class="linenum">29</span> <span class="keyword">raise</span><span class="punct">(</span><span class="constant">RSpec</span><span class="punct">::</span><span class="constant">Expectations</span><span class="punct">::</span><span class="constant">ExpectationNotMetError</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(</span><span class="ident">message</span><span class="punct">))</span></span>
363
- <span class="linenum">30</span> <span class="keyword">end</span></code></pre>
364
- </div>
365
- </dd>
366
- </dl>
367
- </div>
368
- <div id="div_group_7" class="example_group passed">
369
- <dl style="margin-left: 0px;">
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>
372
- <script type="text/javascript">makeRed('example_group_7');</script>
373
- <script type="text/javascript">moveProgressBar('85.7');</script>
374
- <dd class="example failed">
375
- <span class="failed_spec_name">fails with a backtrace that has no file</span>
376
- <div class="failure" id="failure_3">
377
- <div class="message"><pre>foo</pre></div>
378
- <div class="backtrace"><pre>(erb):1</pre></div>
379
- <pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for (erb)</span></code></pre>
380
- </div>
381
- </dd>
382
- <script type="text/javascript">moveProgressBar('100.0');</script>
383
- <dd class="example failed">
384
- <span class="failed_spec_name">fails with a backtrace containing an erb file</span>
385
- <div class="failure" id="failure_4">
386
- <div class="message"><pre>Exception</pre></div>
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>
388
- <pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
389
- </div>
390
- </dd>
391
- </dl>
392
- </div>
393
- <script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>x seconds</strong>";</script>
394
- <script type="text/javascript">document.getElementById('totals').innerHTML = "7 examples, 4 failures, 2 pending";</script>
395
- </div>
396
- </div>
397
- </body>
398
- </html>