rspec-core 2.12.0 → 2.12.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,20 @@
1
+ ### 2.12.1 / 2012-12-01
2
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.12.0...v2.12.1)
3
+
4
+ Bug fixes
5
+
6
+ * Specs are run even if another at\_exit hook calls `exit`. This allows
7
+ Test::Unit and RSpec to run together. (Suraj N. Kurapati)
8
+ * Fix full doc string concatenation so that it handles the case of a
9
+ method string (e.g. "#foo") being nested under a context string
10
+ (e.g. "when it is tuesday"), so that we get "when it is tuesday #foo"
11
+ rather than "when it is tuesday#foo". (Myron Marston)
12
+ * Restore public API I unintentionally broke in 2.12.0:
13
+ `RSpec::Core::Formatters::BaseFormatter#format_backtrce(backtrace, example)`
14
+ (Myron Marston).
15
+
1
16
  ### 2.12.0 / 2012-11-12
2
- [full changelog](http://github.com/rspec/rspec-core/compare/v2.11.1...2.12.0)
17
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.11.1...v2.12.0)
3
18
 
4
19
  Enhancements
5
20
 
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  rspec-core provides the structure for writing executable examples of how your
4
4
  code should behave, and an `rspec` command with tools to constrain which
5
- examples get run and taylor the output.
5
+ examples get run and tailor the output.
6
6
 
7
7
  ## install
8
8
 
@@ -65,19 +65,18 @@ Feature: exit status
65
65
  Then the exit status should be 2
66
66
  And the output should contain "1 example, 1 failure"
67
67
 
68
- @wip
69
68
  Scenario: exit with rspec's exit code when an at_exit hook is added upstream
70
69
  Given a file named "exit_at_spec.rb" with:
71
70
  """ruby
72
71
  require 'rspec/autorun'
72
+ at_exit { exit(0) }
73
73
 
74
74
  describe "exit 0 at_exit" do
75
75
  it "does not interfere with rspec's exit code" do
76
- at_exit { exit 0 }
77
76
  fail
78
77
  end
79
78
  end
80
79
  """
81
- When I run `rspec exit_at_spec.rb`
80
+ When I run `ruby exit_at_spec.rb`
82
81
  Then the exit status should be 1
83
82
  And the output should contain "1 example, 1 failure"
@@ -7,6 +7,6 @@ Before do
7
7
  set_env('JAVA_OPTS', '-d32') # force jRuby to use client JVM for faster startup times
8
8
  @aruba_timeout_seconds = 60
9
9
  else
10
- @aruba_timeout_seconds = 5
10
+ @aruba_timeout_seconds = 10
11
11
  end
12
12
  end
@@ -4,6 +4,11 @@ module RSpec
4
4
  module Core
5
5
  # Stores runtime configuration information.
6
6
  #
7
+ # Configuration options are loaded from `~/.rspec`, `.rspec`,
8
+ # `.rspec-local`, command line switches, and the `SPEC_OPTS` environment
9
+ # variable (listed in lowest to highest precedence; for example, an option
10
+ # in `~/.rspec` can be overridden by an option in `.rspec-local`).
11
+ #
7
12
  # @example Standard settings
8
13
  # RSpec.configure do |c|
9
14
  # c.drb = true
@@ -117,6 +117,14 @@ module RSpec
117
117
  restore_sync_output
118
118
  end
119
119
 
120
+ # @api public
121
+ #
122
+ # Formats the given backtrace based on configuration and
123
+ # the metadata of the given example.
124
+ def format_backtrace(backtrace, example)
125
+ super(backtrace, example.metadata)
126
+ end
127
+
120
128
  protected
121
129
 
122
130
  def configuration
@@ -160,7 +160,7 @@ module RSpec
160
160
  end
161
161
 
162
162
  def dump_backtrace(example)
163
- format_backtrace(example.execution_result[:exception].backtrace, example.metadata).each do |backtrace_info|
163
+ format_backtrace(example.execution_result[:exception].backtrace, example).each do |backtrace_info|
164
164
  output.puts cyan("#{long_padding}# #{backtrace_info}")
165
165
  end
166
166
  end
@@ -86,7 +86,7 @@ module RSpec
86
86
  exception_details = if exception
87
87
  {
88
88
  :message => exception.message,
89
- :backtrace => format_backtrace(exception.backtrace, example.metadata).join("\n")
89
+ :backtrace => format_backtrace(exception.backtrace, example).join("\n")
90
90
  }
91
91
  else
92
92
  false
@@ -89,10 +89,19 @@ module RSpec
89
89
  self[:caller].detect {|l| l !~ /\/lib\/rspec\/core/}
90
90
  end
91
91
 
92
- def build_description_from(*parts)
93
- parts.map {|p| p.to_s}.inject do |desc, p|
94
- p =~ /^(#|::|\.)/ ? "#{desc}#{p}" : "#{desc} #{p}"
95
- end || ""
92
+ def method_description_after_module?(parent_part, child_part)
93
+ return false unless parent_part.is_a?(Module)
94
+ child_part =~ /^(#|::|\.)/
95
+ end
96
+
97
+ def build_description_from(first_part = '', *parts)
98
+ description, _ = parts.inject([first_part.to_s, first_part]) do |(desc, last_part), this_part|
99
+ this_part = this_part.to_s
100
+ this_part = (' ' + this_part) unless method_description_after_module?(last_part, this_part)
101
+ [(desc + this_part), this_part]
102
+ end
103
+
104
+ description
96
105
  end
97
106
  end
98
107
 
@@ -157,11 +157,21 @@ module RSpec
157
157
 
158
158
  private
159
159
 
160
+ if RUBY_VERSION == '1.8.6'
161
+ def shellescape(string)
162
+ string.gsub(/"/, '\"').gsub(/'/, "\\\\'")
163
+ end
164
+ else
165
+ def shellescape(string)
166
+ string.shellescape
167
+ end
168
+ end
169
+
160
170
  def files_to_run
161
171
  if ENV['SPEC']
162
172
  FileList[ ENV['SPEC'] ].sort
163
173
  else
164
- FileList[ pattern ].sort.map { |f| f.shellescape }
174
+ FileList[ pattern ].sort.map { |f| shellescape(f) }
165
175
  end
166
176
  end
167
177
 
@@ -5,7 +5,18 @@ module RSpec
5
5
  # Register an at_exit hook that runs the suite.
6
6
  def self.autorun
7
7
  return if autorun_disabled? || installed_at_exit? || running_in_drb?
8
- at_exit { exit run(ARGV, $stderr, $stdout).to_i unless $! }
8
+ at_exit do
9
+ # Don't bother running any specs and just let the program terminate
10
+ # if we got here due to an unrescued exception (anything other than
11
+ # SystemExit, which is raised when somebody calls Kernel#exit).
12
+ next unless $!.nil? || $!.kind_of?(SystemExit)
13
+
14
+ # We got here because either the end of the program was reached or
15
+ # somebody called Kernel#exit. Run the specs and then override any
16
+ # existing exit status with RSpec's exit status if any specs failed.
17
+ status = run(ARGV, $stderr, $stdout).to_i
18
+ exit status if status != 0
19
+ end
9
20
  @installed_at_exit = true
10
21
  end
11
22
  AT_EXIT_HOOK_BACKTRACE_LINE = "#{__FILE__}:#{__LINE__ - 2}:in `autorun'"
@@ -1,7 +1,7 @@
1
1
  module RSpec
2
2
  module Core
3
3
  module Version
4
- STRING = '2.12.0'
4
+ STRING = '2.12.1'
5
5
  end
6
6
  end
7
7
  end
@@ -101,7 +101,7 @@ describe RSpec::Core::Formatters::BaseFormatter do
101
101
  end
102
102
 
103
103
  it "removes lines from rspec and lines that come before the invocation of the at_exit autorun hook" do
104
- formatter.format_backtrace(backtrace).should eq(["./my_spec.rb:5"])
104
+ formatter.format_backtrace(backtrace, stub.as_null_object).should eq(["./my_spec.rb:5"])
105
105
  end
106
106
  end
107
107
 
@@ -0,0 +1,410 @@
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
+ dd .duration {
159
+ padding-left: 5px;
160
+ text-align: right;
161
+ right: 0px;
162
+ float:right;
163
+ }
164
+
165
+ dd.example.passed {
166
+ border-left: 5px solid #65C400;
167
+ border-bottom: 1px solid #65C400;
168
+ background: #DBFFB4; color: #3D7700;
169
+ }
170
+
171
+ dd.example.not_implemented {
172
+ border-left: 5px solid #FAF834;
173
+ border-bottom: 1px solid #FAF834;
174
+ background: #FCFB98; color: #131313;
175
+ }
176
+
177
+ dd.example.pending_fixed {
178
+ border-left: 5px solid #0000C2;
179
+ border-bottom: 1px solid #0000C2;
180
+ color: #0000C2; background: #D3FBFF;
181
+ }
182
+
183
+ dd.example.failed {
184
+ border-left: 5px solid #C20000;
185
+ border-bottom: 1px solid #C20000;
186
+ color: #C20000; background: #FFFBD3;
187
+ }
188
+
189
+
190
+ dt.not_implemented {
191
+ color: #000000; background: #FAF834;
192
+ }
193
+
194
+ dt.pending_fixed {
195
+ color: #FFFFFF; background: #C40D0D;
196
+ }
197
+
198
+ dt.failed {
199
+ color: #FFFFFF; background: #C40D0D;
200
+ }
201
+
202
+
203
+ #rspec-header.not_implemented {
204
+ color: #000000; background: #FAF834;
205
+ }
206
+
207
+ #rspec-header.pending_fixed {
208
+ color: #FFFFFF; background: #C40D0D;
209
+ }
210
+
211
+ #rspec-header.failed {
212
+ color: #FFFFFF; background: #C40D0D;
213
+ }
214
+
215
+
216
+ .backtrace {
217
+ color: #000;
218
+ font-size: 12px;
219
+ }
220
+
221
+ a {
222
+ color: #BE5C00;
223
+ }
224
+
225
+ /* Ruby code, style similar to vibrant ink */
226
+ .ruby {
227
+ font-size: 12px;
228
+ font-family: monospace;
229
+ color: white;
230
+ background-color: black;
231
+ padding: 0.1em 0 0.2em 0;
232
+ }
233
+
234
+ .ruby .keyword { color: #FF6600; }
235
+ .ruby .constant { color: #339999; }
236
+ .ruby .attribute { color: white; }
237
+ .ruby .global { color: white; }
238
+ .ruby .module { color: white; }
239
+ .ruby .class { color: white; }
240
+ .ruby .string { color: #66FF00; }
241
+ .ruby .ident { color: white; }
242
+ .ruby .method { color: #FFCC00; }
243
+ .ruby .number { color: white; }
244
+ .ruby .char { color: white; }
245
+ .ruby .comment { color: #9933CC; }
246
+ .ruby .symbol { color: white; }
247
+ .ruby .regex { color: #44B4CC; }
248
+ .ruby .punct { color: white; }
249
+ .ruby .escape { color: white; }
250
+ .ruby .interp { color: white; }
251
+ .ruby .expr { color: white; }
252
+
253
+ .ruby .offending { background-color: gray; }
254
+ .ruby .linenum {
255
+ width: 75px;
256
+ padding: 0.1em 1em 0.2em 0;
257
+ color: #000000;
258
+ background-color: #FFFBD3;
259
+ }
260
+
261
+ </style>
262
+ </head>
263
+ <body>
264
+ <div class="rspec-report">
265
+
266
+ <div id="rspec-header">
267
+ <div id="label">
268
+ <h1>RSpec Code Examples</h1>
269
+ </div>
270
+
271
+ <div id="display-filters">
272
+ <input id="passed_checkbox" name="passed_checkbox" type="checkbox" checked onchange="apply_filters()" value="1"> <label for="passed_checkbox">Passed</label>
273
+ <input id="failed_checkbox" name="failed_checkbox" type="checkbox" checked onchange="apply_filters()" value="2"> <label for="failed_checkbox">Failed</label>
274
+ <input id="pending_checkbox" name="pending_checkbox" type="checkbox" checked onchange="apply_filters()" value="3"> <label for="pending_checkbox">Pending</label>
275
+ </div>
276
+
277
+ <div id="summary">
278
+ <p id="totals">&nbsp;</p>
279
+ <p id="duration">&nbsp;</p>
280
+ </div>
281
+ </div>
282
+
283
+
284
+ <div class="results">
285
+ <div id="div_group_1" class="example_group passed">
286
+ <dl style="margin-left: 0px;">
287
+ <dt id="example_group_1" class="passed">pending spec with no implementation</dt>
288
+ <script type="text/javascript">makeYellow('rspec-header');</script>
289
+ <script type="text/javascript">makeYellow('div_group_1');</script>
290
+ <script type="text/javascript">makeYellow('example_group_1');</script>
291
+ <script type="text/javascript">moveProgressBar('14.2');</script>
292
+ <dd class="example not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: Not yet implemented)</span></dd>
293
+ </dl>
294
+ </div>
295
+ <div id="div_group_2" class="example_group passed">
296
+ <dl style="margin-left: 0px;">
297
+ <dt id="example_group_2" class="passed">pending command with block format</dt>
298
+ </dl>
299
+ </div>
300
+ <div id="div_group_3" class="example_group passed">
301
+ <dl style="margin-left: 15px;">
302
+ <dt id="example_group_3" class="passed">with content that would fail</dt>
303
+ <script type="text/javascript">makeYellow('rspec-header');</script>
304
+ <script type="text/javascript">makeYellow('div_group_3');</script>
305
+ <script type="text/javascript">makeYellow('example_group_3');</script>
306
+ <script type="text/javascript">moveProgressBar('28.5');</script>
307
+ <dd class="example not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: No reason given)</span></dd>
308
+ </dl>
309
+ </div>
310
+ <div id="div_group_4" class="example_group passed">
311
+ <dl style="margin-left: 15px;">
312
+ <dt id="example_group_4" class="passed">with content that would pass</dt>
313
+ <script type="text/javascript">makeRed('rspec-header');</script>
314
+ <script type="text/javascript">makeRed('div_group_4');</script>
315
+ <script type="text/javascript">makeRed('example_group_4');</script>
316
+ <script type="text/javascript">moveProgressBar('42.8');</script>
317
+ <dd class="example pending_fixed">
318
+ <span class="failed_spec_name">fails</span>
319
+ <span class="duration">n.nnnns</span>
320
+ <div class="failure" id="failure_1">
321
+ <div class="message"><pre>RSpec::Core::Pending::PendingExampleFixedError</pre></div>
322
+ <div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:18:in `(root)'
323
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:32:in `Formatters'
324
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:54:in `Formatters'
325
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:54:in `Formatters'
326
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:53:in `Formatters'</pre></div>
327
+ <pre class="ruby"><code><span class="linenum">16</span> <span class="ident">context</span> <span class="punct">&quot;</span><span class="string">with content that would pass</span><span class="punct">&quot;</span> <span class="keyword">do</span>
328
+ <span class="linenum">17</span> <span class="ident">it</span> <span class="punct">&quot;</span><span class="string">fails</span><span class="punct">&quot;</span> <span class="keyword">do</span>
329
+ <span class="offending"><span class="linenum">18</span> <span class="ident">pending</span> <span class="keyword">do</span></span>
330
+ <span class="linenum">19</span> <span class="number">1</span><span class="punct">.</span><span class="ident">should</span> <span class="ident">eq</span><span class="punct">(</span><span class="number">1</span><span class="punct">)</span>
331
+ <span class="linenum">20</span> <span class="keyword">end</span></code></pre>
332
+ </div>
333
+ </dd>
334
+ </dl>
335
+ </div>
336
+ <div id="div_group_5" class="example_group passed">
337
+ <dl style="margin-left: 0px;">
338
+ <dt id="example_group_5" class="passed">passing spec</dt>
339
+ <script type="text/javascript">moveProgressBar('57.1');</script>
340
+ <dd class="example passed"><span class="passed_spec_name">passes</span><span class='duration'>n.nnnns</span></dd>
341
+ </dl>
342
+ </div>
343
+ <div id="div_group_6" class="example_group passed">
344
+ <dl style="margin-left: 0px;">
345
+ <dt id="example_group_6" class="passed">failing spec</dt>
346
+ <script type="text/javascript">makeRed('div_group_6');</script>
347
+ <script type="text/javascript">makeRed('example_group_6');</script>
348
+ <script type="text/javascript">moveProgressBar('71.4');</script>
349
+ <dd class="example failed">
350
+ <span class="failed_spec_name">fails</span>
351
+ <span class="duration">n.nnnns</span>
352
+ <div class="failure" id="failure_2">
353
+ <div class="message"><pre>
354
+ expected: 2
355
+ got: 1
356
+
357
+ (compared using ==)
358
+ </pre></div>
359
+ <div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:33:in `(root)'
360
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:32:in `Formatters'
361
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:54:in `Formatters'
362
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:54:in `Formatters'
363
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:53:in `Formatters'</pre></div>
364
+ <pre class="ruby"><code><span class="linenum">31</span><span class="ident">describe</span> <span class="punct">&quot;</span><span class="string">failing spec</span><span class="punct">&quot;</span> <span class="keyword">do</span>
365
+ <span class="linenum">32</span> <span class="ident">it</span> <span class="punct">&quot;</span><span class="string">fails</span><span class="punct">&quot;</span> <span class="keyword">do</span>
366
+ <span class="offending"><span class="linenum">33</span> <span class="number">1</span><span class="punct">.</span><span class="ident">should</span> <span class="ident">eq</span><span class="punct">(</span><span class="number">2</span><span class="punct">)</span></span>
367
+ <span class="linenum">34</span> <span class="keyword">end</span>
368
+ <span class="linenum">35</span><span class="keyword">end</span></code></pre>
369
+ </div>
370
+ </dd>
371
+ </dl>
372
+ </div>
373
+ <div id="div_group_7" class="example_group passed">
374
+ <dl style="margin-left: 0px;">
375
+ <dt id="example_group_7" class="passed">a failing spec with odd backtraces</dt>
376
+ <script type="text/javascript">makeRed('div_group_7');</script>
377
+ <script type="text/javascript">makeRed('example_group_7');</script>
378
+ <script type="text/javascript">moveProgressBar('85.7');</script>
379
+ <dd class="example failed">
380
+ <span class="failed_spec_name">fails with a backtrace that has no file</span>
381
+ <span class="duration">n.nnnns</span>
382
+ <div class="failure" id="failure_3">
383
+ <div class="message"><pre>foo</pre></div>
384
+ <div class="backtrace"><pre>(erb):1:in `result'
385
+ ./spec/rspec/core/resources/formatter_specs.rb:41:in `(root)'
386
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:32:in `Formatters'
387
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:54:in `Formatters'
388
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:54:in `Formatters'
389
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:53:in `Formatters'</pre></div>
390
+ <pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for (erb)</span></code></pre>
391
+ </div>
392
+ </dd>
393
+ <script type="text/javascript">moveProgressBar('100.0');</script>
394
+ <dd class="example failed">
395
+ <span class="failed_spec_name">fails with a backtrace containing an erb file</span>
396
+ <span class="duration">n.nnnns</span>
397
+ <div class="failure" id="failure_4">
398
+ <div class="message"><pre>Exception</pre></div>
399
+ <div class="backtrace"><pre>/foo.html.erb:1:in `<main>': foo (RuntimeError)</pre></div>
400
+ <pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
401
+ </div>
402
+ </dd>
403
+ </dl>
404
+ </div>
405
+ <script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>n.nnnn seconds</strong>";</script>
406
+ <script type="text/javascript">document.getElementById('totals').innerHTML = "7 examples, 4 failures, 2 pending";</script>
407
+ </div>
408
+ </div>
409
+ </body>
410
+ </html>