rspec-core 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -14,7 +14,7 @@ gem "syntax"
14
14
  gem "rspec-core", :path => "."
15
15
  gem "rspec-expectations", :path => "../rspec-expectations"
16
16
  gem "rspec-mocks", :path => "../rspec-mocks"
17
- gem "relish"
17
+
18
18
  unless RUBY_PLATFORM == "java"
19
19
  gem "ruby-prof"
20
20
  case RUBY_VERSION
@@ -1,5 +1,16 @@
1
1
  ## rspec-core release history (incomplete)
2
2
 
3
+ ### 2.0.1 / 2010-10-18
4
+
5
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.0.0...v2.0.1)
6
+
7
+ * Bug fixes
8
+ * restore color when using spork + autotest
9
+ * Pending examples without docstrings render the correct message (Josep M. Bach)
10
+ * Fixed bug where a failure in a spec file ending in anything but _spec.rb would
11
+ fail in a confusing way.
12
+ * Support backtrace lines from erb templates in html formatter (Alex Crichton)
13
+
3
14
  ### 2.0.0 / 2010-10-10
4
15
 
5
16
  [full changelog](http://github.com/rspec/rspec-core/compare/v2.0.0.rc...v2.0.0)
@@ -86,12 +86,55 @@ Feature: pending examples
86
86
  end
87
87
  end
88
88
  """
89
- When I run "rspec pending_with_xit_spec.rb"
90
- Then the exit status should be 0
91
- And the output should contain "1 example, 0 failures, 1 pending"
92
- And the output should contain:
89
+ When I run "rspec pending_with_xit_spec.rb"
90
+ Then the exit status should be 0
91
+ And the output should contain "1 example, 0 failures, 1 pending"
92
+ And the output should contain:
93
93
  """
94
94
  Pending:
95
95
  an example is pending using xit
96
96
  """
97
97
 
98
+ Scenario: example with no docstring and pending method using documentation formatter
99
+ Given a file named "pending_with_no_docstring_spec.rb" with:
100
+ """
101
+ describe "an example" do
102
+ it "checks something" do
103
+ (3+4).should == 7
104
+ end
105
+ specify do
106
+ pending
107
+ end
108
+ end
109
+ """
110
+ When I run "rspec pending_with_no_docstring_spec.rb --format documentation"
111
+ Then the exit status should be 0
112
+ And the output should contain "2 examples, 0 failures, 1 pending"
113
+ And the output should contain:
114
+ """
115
+ an example
116
+ checks something
117
+ (PENDING: No reason given)
118
+ """
119
+
120
+ Scenario: pending with no docstring using documentation formatter
121
+ Given a file named "pending_with_no_docstring_spec.rb" with:
122
+ """
123
+ describe "an example" do
124
+ it "checks something" do
125
+ (3+4).should == 7
126
+ end
127
+ pending do
128
+ "string".reverse.should == "gnirts"
129
+ end
130
+ end
131
+ """
132
+ When I run "rspec pending_with_no_docstring_spec.rb --format documentation"
133
+ Then the exit status should be 0
134
+ And the output should contain "2 examples, 0 failures, 1 pending"
135
+ And the output should contain:
136
+ """
137
+ an example
138
+ checks something
139
+ (PENDING: Not Yet Implemented)
140
+ """
@@ -28,6 +28,7 @@ module RSpec
28
28
  argv << "--color" if options[:color_enabled]
29
29
  argv << "--profile" if options[:profile_examples]
30
30
  argv << "--backtrace" if options[:full_backtrace]
31
+ argv << "--autotest" if options[:autotest]
31
32
  argv << "--format" << options[:formatter] if options[:formatter]
32
33
  argv << "--line_number" << options[:line_number] if options[:line_number]
33
34
  argv << "--example" << options[:full_description].source if options[:full_description]
@@ -129,7 +129,7 @@ module RSpec
129
129
  end
130
130
 
131
131
  def assign_auto_description
132
- if description.empty?
132
+ if description.empty? and !pending?
133
133
  metadata[:description] = RSpec::Matchers.generated_description
134
134
  RSpec::Matchers.clear_generated_description
135
135
  end
@@ -42,7 +42,6 @@ module RSpec
42
42
  module_eval(<<-END_RUBY, __FILE__, __LINE__)
43
43
  def self.#{name}(desc=nil, options={}, &block)
44
44
  options.update(:pending => true) unless block
45
- options.update(:caller => caller)
46
45
  options.update(#{extra_options.inspect})
47
46
  examples << RSpec::Core::Example.new(self, desc, options, block)
48
47
  examples.last
@@ -95,7 +94,7 @@ module RSpec
95
94
  end
96
95
 
97
96
  def self.descendant_filtered_examples
98
- @descendant_filtered_examples ||= filtered_examples + children.collect{|c| c.descendant_filtered_examples}.flatten
97
+ @descendant_filtered_examples ||= filtered_examples + children.inject([]){|l,c| l + c.descendant_filtered_examples}
99
98
  end
100
99
 
101
100
  def self.metadata
@@ -111,7 +110,6 @@ module RSpec
111
110
  @_subclass_count += 1
112
111
  args << {} unless args.last.is_a?(Hash)
113
112
  args.last.update(:example_group_block => example_group_block)
114
- args.last.update(:caller => caller)
115
113
 
116
114
  # TODO 2010-05-05: Because we don't know if const_set is thread-safe
117
115
  child = const_set(
@@ -138,7 +136,7 @@ module RSpec
138
136
  end
139
137
 
140
138
  def self.descendants
141
- @_descendants ||= [self] + children.collect {|c| c.descendants}.flatten
139
+ @_descendants ||= [self] + children.inject([]) {|list, c| list + c.descendants}
142
140
  end
143
141
 
144
142
  def self.ancestors
@@ -216,7 +214,7 @@ An error occurred in an after(:all) hook.
216
214
  end
217
215
 
218
216
  def self.around_hooks
219
- @around_hooks ||= (world.find_hook(:around, :each, self) + ancestors.reverse.map{|a| a.find_hook(:around, :each, self)}).flatten
217
+ @around_hooks ||= (world.find_hook(:around, :each, self) + ancestors.reverse.inject([]){|l,a| l + a.find_hook(:around, :each, self)})
220
218
  end
221
219
 
222
220
  def self.run(reporter)
@@ -276,7 +274,7 @@ An error occurred in an after(:all) hook.
276
274
  def self.declaration_line_numbers
277
275
  @declaration_line_numbers ||= [metadata[:example_group][:line_number]] +
278
276
  examples.collect {|e| e.metadata[:line_number]} +
279
- children.collect {|c| c.declaration_line_numbers}.flatten
277
+ children.inject([]) {|l,c| l + c.declaration_line_numbers}
280
278
  end
281
279
 
282
280
  def self.top_level_description
@@ -3,7 +3,6 @@ module RSpec
3
3
  module ObjectExtensions
4
4
  def describe(*args, &example_group_block)
5
5
  args << {} unless args.last.is_a?(Hash)
6
- args.last.update :caller => caller(1)
7
6
  RSpec::Core::ExampleGroup.describe(*args, &example_group_block)
8
7
  end
9
8
  end
@@ -7,9 +7,11 @@ module RSpec
7
7
  class TextMateFormatter < HtmlFormatter
8
8
  def backtrace_line(line)
9
9
  if line = super(line)
10
- line.sub!(/([^:]*\.rb):(\d*)/) do
10
+ line.sub!(/([^:]*\.e?rb):(\d*)/) do
11
11
  "<a href=\"txmt://open?url=file://#{File.expand_path($1)}&line=#{$2}\">#{$1}:#{$2}</a> "
12
12
  end
13
+
14
+ line
13
15
  end
14
16
  end
15
17
  end
@@ -32,9 +32,7 @@ module RSpec
32
32
  self[:example_group][:full_description] = full_description_from(*args)
33
33
 
34
34
  self[:example_group][:block] = user_metadata.delete(:example_group_block)
35
- self[:example_group][:caller] = user_metadata.delete(:caller) || caller(1)
36
- self[:example_group][:file_path] = file_path_from(self[:example_group], user_metadata.delete(:file_path))
37
- self[:example_group][:line_number] = line_number_from(self[:example_group], user_metadata.delete(:line_number))
35
+ self[:example_group][:file_path], self[:example_group][:line_number] = file_and_line_number_from(caller)
38
36
  self[:example_group][:location] = location_from(self[:example_group])
39
37
 
40
38
  update(user_metadata)
@@ -70,11 +68,7 @@ EOM
70
68
  store(:description, description.to_s)
71
69
  store(:full_description, "#{self[:example_group][:full_description]} #{self[:description]}")
72
70
  store(:execution_result, {})
73
- store(:caller, options.delete(:caller))
74
- if self[:caller]
75
- store(:file_path, file_path_from(self))
76
- store(:line_number, line_number_from(self))
77
- end
71
+ self[:file_path], self[:line_number] = file_and_line_number_from(caller)
78
72
  self[:location] = location_from(self)
79
73
  update(options)
80
74
  end
@@ -153,31 +147,19 @@ EOM
153
147
  end
154
148
  end
155
149
 
156
- def file_path_from(metadata, given_file_path=nil)
157
- return given_file_path if given_file_path
158
- file = file_and_line_number(metadata)[0] if file_and_line_number(metadata)
159
- file.strip if file
150
+ def file_and_line_number_from(list)
151
+ entry = first_caller_from_outside_rspec_from_caller(list)
152
+ entry =~ /(.+?):(\d+)(|:\d+)/
153
+ return [$1, $2.to_i]
160
154
  end
161
155
 
162
- def line_number_from(metadata, given_line_number=nil)
163
- return given_line_number if given_line_number
164
- line_number = file_and_line_number(metadata)[1] if file_and_line_number(metadata)
165
- line_number && line_number.to_i
156
+ def first_caller_from_outside_rspec_from_caller(list)
157
+ list.detect {|l| l !~ /\/lib\/rspec\/core/}
166
158
  end
167
159
 
168
160
  def location_from(metadata)
169
161
  "#{metadata[:file_path]}:#{metadata[:line_number]}"
170
162
  end
171
-
172
- def file_and_line_number(metadata)
173
- entry = candidate_entries_from_caller(metadata).first
174
- entry && entry.match(/(.+?):(\d+)(|:\d+)/)[1..2]
175
- end
176
-
177
- def candidate_entries_from_caller(metadata)
178
- metadata[:caller].grep(/\_spec\.rb:/i)
179
- end
180
-
181
163
  end
182
164
  end
183
165
  end
@@ -1,7 +1,7 @@
1
1
  module RSpec # :nodoc:
2
2
  module Core # :nodoc:
3
3
  module Version # :nodoc:
4
- STRING = '2.0.0'
4
+ STRING = '2.0.1'
5
5
  end
6
6
  end
7
7
  end
@@ -33,11 +33,11 @@ Gem::Specification.new do |s|
33
33
  **************************************************
34
34
  }
35
35
 
36
- s.add_development_dependency "rspec-expectations", ">= #{RSpec::Core::Version::STRING}"
37
- s.add_development_dependency "rspec-mocks", ">= #{RSpec::Core::Version::STRING}"
38
- s.add_development_dependency "cucumber", ">= 0.5.3"
39
- s.add_development_dependency "autotest", ">= 4.2.9"
40
- s.add_development_dependency "syntax", ">= 1.0.0"
36
+ s.add_development_dependency "rspec-expectations", "~> 2.0.1"
37
+ s.add_development_dependency "rspec-mocks", "~> 2.0.1"
38
+ s.add_development_dependency "cucumber", "~> 0.9.2"
39
+ s.add_development_dependency "autotest", "~> 4.2.9"
40
+ s.add_development_dependency "syntax", "~> 1.0.0"
41
41
  s.add_development_dependency "flexmock"
42
42
  s.add_development_dependency "mocha"
43
43
  s.add_development_dependency "rr"
@@ -191,8 +191,8 @@ describe RSpec::Core::ConfigurationOptions do
191
191
  it "renders all the original arguments except --drb" do
192
192
  File.stub(:exist?) { true }
193
193
  IO.stub(:read) { "--drb --color" }
194
- config_options_object(*%w[ --format s --line_number 1 --example pattern --profile --backtrace ]).
195
- drb_argv.should eq(%w[ --color --profile --backtrace --format s --line_number 1 --example pattern ])
194
+ config_options_object(*%w[ --autotest --format s --line_number 1 --example pattern --profile --backtrace ]).
195
+ drb_argv.should eq(%w[ --color --profile --backtrace --autotest --format s --line_number 1 --example pattern ])
196
196
  end
197
197
  end
198
198
 
@@ -186,12 +186,6 @@ module RSpec::Core
186
186
  ExampleGroup.describe(Object, nil, 'foo' => 'bar') { }.metadata.should include({ "foo" => 'bar' })
187
187
  end
188
188
 
189
- it "adds the caller to metadata" do
190
- ExampleGroup.describe(Object) { }.metadata[:example_group][:caller].any? {|f|
191
- f =~ /#{__FILE__}/
192
- }.should be_true
193
- end
194
-
195
189
  it "adds the the file_path to metadata" do
196
190
  ExampleGroup.describe(Object) { }.metadata[:example_group][:file_path].should == __FILE__
197
191
  end
@@ -184,7 +184,7 @@ a {
184
184
  <dt id="example_group_1">pending spec with no implementation</dt>
185
185
  <script type="text/javascript">makeYellow('rspec-header');</script>
186
186
  <script type="text/javascript">makeYellow('example_group_1');</script>
187
- <script type="text/javascript">moveProgressBar('20.0');</script>
187
+ <script type="text/javascript">moveProgressBar('14.2');</script>
188
188
  <dd class="spec not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: Not Yet Implemented)</span></dd>
189
189
  </dl>
190
190
  </div>
@@ -198,7 +198,7 @@ a {
198
198
  <dt id="example_group_3">with content that would fail</dt>
199
199
  <script type="text/javascript">makeYellow('rspec-header');</script>
200
200
  <script type="text/javascript">makeYellow('example_group_3');</script>
201
- <script type="text/javascript">moveProgressBar('40.0');</script>
201
+ <script type="text/javascript">moveProgressBar('28.5');</script>
202
202
  <dd class="spec not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: No reason given)</span></dd>
203
203
  </dl>
204
204
  </div>
@@ -207,24 +207,18 @@ a {
207
207
  <dt id="example_group_4">with content that would pass</dt>
208
208
  <script type="text/javascript">makeRed('rspec-header');</script>
209
209
  <script type="text/javascript">makeRed('example_group_4');</script>
210
- <script type="text/javascript">moveProgressBar('60.0');</script>
210
+ <script type="text/javascript">moveProgressBar('42.8');</script>
211
211
  <dd class="spec pending_fixed">
212
212
  <span class="failed_spec_name">fails</span>
213
213
  <div class="failure" id="failure_0">
214
214
  <div class="message"><pre>RSpec::Core::PendingExampleFixedError</pre></div>
215
- <div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:19
216
- ./spec/spec_helper.rb:31:in `run'
217
- ./spec/spec_helper.rb:31:in `run'
215
+ <div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:18
218
216
  ./spec/rspec/core/formatters/html_formatter_spec.rb:24
219
217
  ./spec/rspec/core/formatters/html_formatter_spec.rb:46
220
218
  ./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `open'
221
219
  ./spec/rspec/core/formatters/html_formatter_spec.rb:46
222
220
  ./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `chdir'
223
- ./spec/rspec/core/formatters/html_formatter_spec.rb:45
224
- ./spec/spec_helper.rb:82
225
- ./spec/spec_helper.rb:54:in `instance_eval'
226
- ./spec/spec_helper.rb:54:in `sandboxed'
227
- ./spec/spec_helper.rb:82</pre></div>
221
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:45</pre></div>
228
222
  <pre class="ruby"><code><span class="linenum">11</span> <span class="keyword">rescue</span> <span class="constant">Exception</span> <span class="punct">=&gt;</span> <span class="ident">e</span>
229
223
  <span class="linenum">12</span> <span class="keyword">end</span>
230
224
  <span class="offending"><span class="linenum">13</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>
@@ -237,7 +231,7 @@ a {
237
231
  <div class="example_group">
238
232
  <dl>
239
233
  <dt id="example_group_5">passing spec</dt>
240
- <script type="text/javascript">moveProgressBar('80.0');</script>
234
+ <script type="text/javascript">moveProgressBar('57.1');</script>
241
235
  <dd class="spec passed"><span class="passed_spec_name">passes</span></dd>
242
236
  </dl>
243
237
  </div>
@@ -245,7 +239,7 @@ a {
245
239
  <dl>
246
240
  <dt id="example_group_6">failing spec</dt>
247
241
  <script type="text/javascript">makeRed('example_group_6');</script>
248
- <script type="text/javascript">moveProgressBar('100.0');</script>
242
+ <script type="text/javascript">moveProgressBar('71.4');</script>
249
243
  <dd class="spec failed">
250
244
  <span class="failed_spec_name">fails</span>
251
245
  <div class="failure" id="failure_0">
@@ -255,18 +249,13 @@ expected 2
255
249
 
256
250
  (compared using ==)
257
251
  </pre></div>
258
- <div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:34
259
- ./spec/spec_helper.rb:31:in `run'
252
+ <div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:33
260
253
  ./spec/rspec/core/formatters/html_formatter_spec.rb:24
261
254
  ./spec/rspec/core/formatters/html_formatter_spec.rb:46
262
255
  ./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `open'
263
256
  ./spec/rspec/core/formatters/html_formatter_spec.rb:46
264
257
  ./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `chdir'
265
- ./spec/rspec/core/formatters/html_formatter_spec.rb:45
266
- ./spec/spec_helper.rb:82
267
- ./spec/spec_helper.rb:54:in `instance_eval'
268
- ./spec/spec_helper.rb:54:in `sandboxed'
269
- ./spec/spec_helper.rb:82</pre></div>
258
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:45</pre></div>
270
259
  <pre class="ruby"><code><span class="linenum">27</span> <span class="keyword">end</span>
271
260
  <span class="linenum">28</span>
272
261
  <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>
@@ -275,8 +264,32 @@ expected 2
275
264
  </dd>
276
265
  </dl>
277
266
  </div>
267
+ <div class="example_group">
268
+ <dl>
269
+ <dt id="example_group_7">a failing spec with odd backtraces</dt>
270
+ <script type="text/javascript">makeRed('example_group_7');</script>
271
+ <script type="text/javascript">moveProgressBar('85.7');</script>
272
+ <dd class="spec failed">
273
+ <span class="failed_spec_name">fails with a backtrace that has no file</span>
274
+ <div class="failure" id="failure_0">
275
+ <div class="message"><pre>foo</pre></div>
276
+ <div class="backtrace"><pre>(erb):1</pre></div>
277
+ <pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for (erb)</span></code></pre>
278
+ </div>
279
+ </dd>
280
+ <script type="text/javascript">moveProgressBar('100.0');</script>
281
+ <dd class="spec failed">
282
+ <span class="failed_spec_name">fails with a backtrace containing an erb file</span>
283
+ <div class="failure" id="failure_0">
284
+ <div class="message"><pre>Exception</pre></div>
285
+ <div class="backtrace"><pre>/foo.html.erb:1:in `<main>': foo (RuntimeError)</pre></div>
286
+ <pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
287
+ </div>
288
+ </dd>
289
+ </dl>
290
+ </div>
278
291
  <script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>x seconds</strong>";</script>
279
- <script type="text/javascript">document.getElementById('totals').innerHTML = "5 examples, 2 failures, 2 pending";</script>
292
+ <script type="text/javascript">document.getElementById('totals').innerHTML = "7 examples, 4 failures, 2 pending";</script>
280
293
  </div>
281
294
  </div>
282
295
  </body>
@@ -184,7 +184,7 @@ a {
184
184
  <dt id="example_group_1">pending spec with no implementation</dt>
185
185
  <script type="text/javascript">makeYellow('rspec-header');</script>
186
186
  <script type="text/javascript">makeYellow('example_group_1');</script>
187
- <script type="text/javascript">moveProgressBar('20.0');</script>
187
+ <script type="text/javascript">moveProgressBar('14.2');</script>
188
188
  <dd class="spec not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: Not Yet Implemented)</span></dd>
189
189
  </dl>
190
190
  </div>
@@ -198,7 +198,7 @@ a {
198
198
  <dt id="example_group_3">with content that would fail</dt>
199
199
  <script type="text/javascript">makeYellow('rspec-header');</script>
200
200
  <script type="text/javascript">makeYellow('example_group_3');</script>
201
- <script type="text/javascript">moveProgressBar('40.0');</script>
201
+ <script type="text/javascript">moveProgressBar('28.5');</script>
202
202
  <dd class="spec not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: No reason given)</span></dd>
203
203
  </dl>
204
204
  </div>
@@ -207,24 +207,18 @@ a {
207
207
  <dt id="example_group_4">with content that would pass</dt>
208
208
  <script type="text/javascript">makeRed('rspec-header');</script>
209
209
  <script type="text/javascript">makeRed('example_group_4');</script>
210
- <script type="text/javascript">moveProgressBar('60.0');</script>
210
+ <script type="text/javascript">moveProgressBar('42.8');</script>
211
211
  <dd class="spec pending_fixed">
212
212
  <span class="failed_spec_name">fails</span>
213
213
  <div class="failure" id="failure_0">
214
214
  <div class="message"><pre>RSpec::Core::PendingExampleFixedError</pre></div>
215
- <div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:19:in `block (3 levels) in <top (required)>'
216
- ./spec/spec_helper.rb:31:in `run'
217
- ./spec/spec_helper.rb:31:in `run'
215
+ <div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:18:in `block (3 levels) in <top (required)>'
218
216
  ./spec/rspec/core/formatters/html_formatter_spec.rb:24:in `block (2 levels) in <module:Formatters>'
219
217
  ./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `block (5 levels) in <module:Formatters>'
220
218
  ./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `open'
221
219
  ./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `block (4 levels) in <module:Formatters>'
222
220
  ./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `chdir'
223
- ./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `block (3 levels) in <module:Formatters>'
224
- ./spec/spec_helper.rb:82:in `block (3 levels) in <top (required)>'
225
- ./spec/spec_helper.rb:54:in `instance_eval'
226
- ./spec/spec_helper.rb:54:in `sandboxed'
227
- ./spec/spec_helper.rb:82:in `block (2 levels) in <top (required)>'</pre></div>
221
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `block (3 levels) in <module:Formatters>'</pre></div>
228
222
  <pre class="ruby"><code><span class="linenum">11</span> <span class="keyword">rescue</span> <span class="constant">Exception</span> <span class="punct">=&gt;</span> <span class="ident">e</span>
229
223
  <span class="linenum">12</span> <span class="keyword">end</span>
230
224
  <span class="offending"><span class="linenum">13</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>
@@ -237,7 +231,7 @@ a {
237
231
  <div class="example_group">
238
232
  <dl>
239
233
  <dt id="example_group_5">passing spec</dt>
240
- <script type="text/javascript">moveProgressBar('80.0');</script>
234
+ <script type="text/javascript">moveProgressBar('57.1');</script>
241
235
  <dd class="spec passed"><span class="passed_spec_name">passes</span></dd>
242
236
  </dl>
243
237
  </div>
@@ -245,7 +239,7 @@ a {
245
239
  <dl>
246
240
  <dt id="example_group_6">failing spec</dt>
247
241
  <script type="text/javascript">makeRed('example_group_6');</script>
248
- <script type="text/javascript">moveProgressBar('100.0');</script>
242
+ <script type="text/javascript">moveProgressBar('71.4');</script>
249
243
  <dd class="spec failed">
250
244
  <span class="failed_spec_name">fails</span>
251
245
  <div class="failure" id="failure_0">
@@ -255,18 +249,13 @@ expected 2
255
249
 
256
250
  (compared using ==)
257
251
  </pre></div>
258
- <div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:34:in `block (2 levels) in <top (required)>'
259
- ./spec/spec_helper.rb:31:in `run'
252
+ <div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:33:in `block (2 levels) in <top (required)>'
260
253
  ./spec/rspec/core/formatters/html_formatter_spec.rb:24:in `block (2 levels) in <module:Formatters>'
261
254
  ./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `block (5 levels) in <module:Formatters>'
262
255
  ./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `open'
263
256
  ./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `block (4 levels) in <module:Formatters>'
264
257
  ./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `chdir'
265
- ./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `block (3 levels) in <module:Formatters>'
266
- ./spec/spec_helper.rb:82:in `block (3 levels) in <top (required)>'
267
- ./spec/spec_helper.rb:54:in `instance_eval'
268
- ./spec/spec_helper.rb:54:in `sandboxed'
269
- ./spec/spec_helper.rb:82:in `block (2 levels) in <top (required)>'</pre></div>
258
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `block (3 levels) in <module:Formatters>'</pre></div>
270
259
  <pre class="ruby"><code><span class="linenum">27</span> <span class="keyword">end</span>
271
260
  <span class="linenum">28</span>
272
261
  <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>
@@ -275,8 +264,39 @@ expected 2
275
264
  </dd>
276
265
  </dl>
277
266
  </div>
267
+ <div class="example_group">
268
+ <dl>
269
+ <dt id="example_group_7">a failing spec with odd backtraces</dt>
270
+ <script type="text/javascript">makeRed('example_group_7');</script>
271
+ <script type="text/javascript">moveProgressBar('85.7');</script>
272
+ <dd class="spec failed">
273
+ <span class="failed_spec_name">fails with a backtrace that has no file</span>
274
+ <div class="failure" id="failure_0">
275
+ <div class="message"><pre>foo</pre></div>
276
+ <div class="backtrace"><pre>(erb):1:in `<main>'
277
+ ./spec/rspec/core/resources/formatter_specs.rb:41:in `block (2 levels) in <top (required)>'
278
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:24:in `block (2 levels) in <module:Formatters>'
279
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `block (5 levels) in <module:Formatters>'
280
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `open'
281
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `block (4 levels) in <module:Formatters>'
282
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `chdir'
283
+ ./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `block (3 levels) in <module:Formatters>'</pre></div>
284
+ <pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for (erb)</span></code></pre>
285
+ </div>
286
+ </dd>
287
+ <script type="text/javascript">moveProgressBar('100.0');</script>
288
+ <dd class="spec failed">
289
+ <span class="failed_spec_name">fails with a backtrace containing an erb file</span>
290
+ <div class="failure" id="failure_0">
291
+ <div class="message"><pre>Exception</pre></div>
292
+ <div class="backtrace"><pre>/foo.html.erb:1:in `<main>': foo (RuntimeError)</pre></div>
293
+ <pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
294
+ </div>
295
+ </dd>
296
+ </dl>
297
+ </div>
278
298
  <script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>x seconds</strong>";</script>
279
- <script type="text/javascript">document.getElementById('totals').innerHTML = "5 examples, 2 failures, 2 pending";</script>
299
+ <script type="text/javascript">document.getElementById('totals').innerHTML = "7 examples, 4 failures, 2 pending";</script>
280
300
  </div>
281
301
  </div>
282
302
  </body>