rspec-core 2.3.1 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.markdown +22 -0
- data/Rakefile +2 -2
- data/features/command_line/README.md +6 -0
- data/features/command_line/configure.feature +16 -14
- data/features/command_line/example_name_option.feature +3 -3
- data/features/command_line/format_option.feature +73 -0
- data/features/command_line/line_number_appended_to_path.feature +1 -1
- data/features/command_line/line_number_option.feature +2 -2
- data/features/command_line/tag.feature +7 -7
- data/features/configuration/read_options_from_file.feature +29 -16
- data/features/hooks/before_and_after_hooks.feature +9 -14
- data/features/hooks/filtering.feature +174 -0
- data/features/step_definitions/additional_cli_steps.rb +4 -0
- data/features/subject/attribute_of_subject.feature +68 -18
- data/lib/rspec/core/command_line_configuration.rb +16 -16
- data/lib/rspec/core/configuration.rb +14 -15
- data/lib/rspec/core/configuration_options.rb +46 -22
- data/lib/rspec/core/example.rb +16 -6
- data/lib/rspec/core/example_group.rb +11 -11
- data/lib/rspec/core/formatters/base_text_formatter.rb +2 -1
- data/lib/rspec/core/hooks.rb +8 -8
- data/lib/rspec/core/option_parser.rb +13 -3
- data/lib/rspec/core/pending.rb +2 -0
- data/lib/rspec/core/rake_task.rb +1 -1
- data/lib/rspec/core/subject.rb +2 -0
- data/lib/rspec/core/version.rb +1 -1
- data/lib/rspec/core/world.rb +2 -2
- data/spec/rspec/core/configuration_options_spec.rb +147 -151
- data/spec/rspec/core/configuration_spec.rb +67 -19
- data/spec/rspec/core/example_spec.rb +12 -10
- data/spec/rspec/core/formatters/base_text_formatter_spec.rb +25 -1
- data/spec/rspec/core/formatters/html_formatted-1.8.6.html +5 -5
- data/spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html +37 -24
- data/spec/rspec/core/formatters/html_formatted-1.8.7.html +5 -5
- data/spec/rspec/core/formatters/html_formatted-1.9.1.html +5 -5
- data/spec/rspec/core/formatters/html_formatted-1.9.2.html +5 -5
- data/spec/rspec/core/formatters/html_formatter_spec.rb +7 -7
- data/spec/rspec/core/formatters/text_mate_formatted-1.8.6.html +19 -19
- data/spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html +51 -33
- data/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +19 -19
- data/spec/rspec/core/formatters/text_mate_formatted-1.9.1.html +26 -26
- data/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +26 -26
- data/spec/rspec/core/formatters/text_mate_formatter_spec.rb +7 -7
- data/spec/rspec/core/hooks_filtering_spec.rb +54 -0
- data/spec/rspec/core/option_parser_spec.rb +53 -17
- data/spec/rspec/core/rake_task_spec.rb +21 -0
- data/spec/spec_helper.rb +1 -1
- metadata +14 -8
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'tmpdir'
|
2
3
|
|
3
4
|
module RSpec::Core
|
4
5
|
|
@@ -350,47 +351,71 @@ module RSpec::Core
|
|
350
351
|
end
|
351
352
|
|
352
353
|
describe 'formatter=' do
|
354
|
+
it "delegates to add_formatter (better API for user-facing configuration)" do
|
355
|
+
config.should_receive(:add_formatter).with('these','options')
|
356
|
+
config.add_formatter('these','options')
|
357
|
+
end
|
358
|
+
end
|
359
|
+
|
360
|
+
describe "add_formatter" do
|
361
|
+
|
362
|
+
it "adds to the list of formatters" do
|
363
|
+
config.add_formatter :documentation
|
364
|
+
config.formatters.first.should be_an_instance_of(Formatters::DocumentationFormatter)
|
365
|
+
end
|
353
366
|
|
354
|
-
it "
|
355
|
-
config.
|
356
|
-
config.
|
357
|
-
config.formatter = 'documentation'
|
358
|
-
config.formatter.should be_an_instance_of(Formatters::DocumentationFormatter)
|
367
|
+
it "finds a formatter by name (w/ Symbol)" do
|
368
|
+
config.add_formatter :documentation
|
369
|
+
config.formatters.first.should be_an_instance_of(Formatters::DocumentationFormatter)
|
359
370
|
end
|
360
371
|
|
361
|
-
it "
|
372
|
+
it "finds a formatter by name (w/ String)" do
|
373
|
+
config.add_formatter 'documentation'
|
374
|
+
config.formatters.first.should be_an_instance_of(Formatters::DocumentationFormatter)
|
375
|
+
end
|
376
|
+
|
377
|
+
it "finds a formatter by class" do
|
362
378
|
formatter_class = Class.new(Formatters::BaseTextFormatter)
|
363
|
-
config.
|
364
|
-
config.
|
379
|
+
config.add_formatter formatter_class
|
380
|
+
config.formatters.first.should be_an_instance_of(formatter_class)
|
365
381
|
end
|
366
382
|
|
367
|
-
it "
|
383
|
+
it "finds a formatter by class name" do
|
368
384
|
Object.const_set("CustomFormatter", Class.new(Formatters::BaseFormatter))
|
369
|
-
config.
|
370
|
-
config.
|
385
|
+
config.add_formatter "CustomFormatter"
|
386
|
+
config.formatters.first.should be_an_instance_of(CustomFormatter)
|
371
387
|
end
|
372
388
|
|
373
|
-
it "
|
389
|
+
it "finds a formatter by class fully qualified name" do
|
374
390
|
RSpec.const_set("CustomFormatter", Class.new(Formatters::BaseFormatter))
|
375
|
-
config.
|
376
|
-
config.
|
391
|
+
config.add_formatter "RSpec::CustomFormatter"
|
392
|
+
config.formatters.first.should be_an_instance_of(RSpec::CustomFormatter)
|
377
393
|
end
|
378
394
|
|
379
|
-
it "requires
|
395
|
+
it "requires a formatter file based on its fully qualified name" do
|
380
396
|
config.should_receive(:require).with('rspec/custom_formatter2') do
|
381
397
|
RSpec.const_set("CustomFormatter2", Class.new(Formatters::BaseFormatter))
|
382
398
|
end
|
383
|
-
config.
|
384
|
-
config.
|
399
|
+
config.add_formatter "RSpec::CustomFormatter2"
|
400
|
+
config.formatters.first.should be_an_instance_of(RSpec::CustomFormatter2)
|
385
401
|
end
|
386
402
|
|
387
403
|
it "raises NameError if class is unresolvable" do
|
388
404
|
config.should_receive(:require).with('rspec/custom_formatter3')
|
389
|
-
lambda { config.
|
405
|
+
lambda { config.add_formatter "RSpec::CustomFormatter3" }.should raise_error(NameError)
|
390
406
|
end
|
391
407
|
|
392
408
|
it "raises ArgumentError if formatter is unknown" do
|
393
|
-
lambda { config.
|
409
|
+
lambda { config.add_formatter :progresss }.should raise_error(ArgumentError)
|
410
|
+
end
|
411
|
+
|
412
|
+
context "with a 2nd arg defining the output" do
|
413
|
+
it "creates a file at that path and sets it as the output" do
|
414
|
+
path = File.join(Dir.tmpdir, 'output.txt')
|
415
|
+
config.add_formatter('doc', path)
|
416
|
+
config.formatters.first.output.should be_a(File)
|
417
|
+
config.formatters.first.output.path.should eq(path)
|
418
|
+
end
|
394
419
|
end
|
395
420
|
|
396
421
|
end
|
@@ -514,10 +539,33 @@ module RSpec::Core
|
|
514
539
|
end
|
515
540
|
|
516
541
|
describe "#debug=true" do
|
542
|
+
before do
|
543
|
+
if defined?(Debugger)
|
544
|
+
@orig_debugger = Debugger
|
545
|
+
Object.send(:remove_const, :Debugger)
|
546
|
+
else
|
547
|
+
@orig_debugger = nil
|
548
|
+
end
|
549
|
+
Object.const_set("Debugger", debugger)
|
550
|
+
end
|
551
|
+
|
552
|
+
after do
|
553
|
+
Object.send(:remove_const, :Debugger)
|
554
|
+
Object.const_set("Debugger", @orig_debugger) if @orig_debugger
|
555
|
+
end
|
556
|
+
|
557
|
+
let(:debugger) { double('Debugger').as_null_object }
|
558
|
+
|
517
559
|
it "requires 'ruby-debug'" do
|
518
560
|
config.should_receive(:require).with('ruby-debug')
|
519
561
|
config.debug = true
|
520
562
|
end
|
563
|
+
|
564
|
+
it "starts the debugger" do
|
565
|
+
config.stub(:require)
|
566
|
+
debugger.should_receive(:start)
|
567
|
+
config.debug = true
|
568
|
+
end
|
521
569
|
end
|
522
570
|
|
523
571
|
describe "#debug=false" do
|
@@ -122,39 +122,41 @@ describe RSpec::Core::Example, :parent_metadata => 'sample' do
|
|
122
122
|
end
|
123
123
|
|
124
124
|
context "in before(:each)" do
|
125
|
-
it "sets
|
125
|
+
it "sets each example to pending" do
|
126
126
|
group = RSpec::Core::ExampleGroup.describe do
|
127
127
|
before(:each) { pending }
|
128
128
|
example {}
|
129
|
+
example {}
|
129
130
|
end
|
130
131
|
group.run
|
131
132
|
group.examples.first.should be_pending
|
133
|
+
group.examples.last.should be_pending
|
132
134
|
end
|
133
135
|
end
|
134
136
|
|
135
|
-
context "in
|
136
|
-
it "sets
|
137
|
+
context "in before(:all)" do
|
138
|
+
it "sets each example to pending" do
|
137
139
|
group = RSpec::Core::ExampleGroup.describe do
|
138
|
-
|
140
|
+
before(:all) { pending }
|
141
|
+
example {}
|
139
142
|
example {}
|
140
143
|
end
|
141
144
|
group.run
|
142
145
|
group.examples.first.should be_pending
|
146
|
+
group.examples.last.should be_pending
|
143
147
|
end
|
144
148
|
end
|
145
149
|
|
146
|
-
context "in
|
147
|
-
|
150
|
+
context "in around(:each)" do
|
151
|
+
it "sets the example to pending" do
|
148
152
|
group = RSpec::Core::ExampleGroup.describe do
|
149
|
-
|
153
|
+
around(:each) { pending }
|
150
154
|
example {}
|
151
155
|
end
|
152
156
|
group.run
|
153
157
|
group.examples.first.should be_pending
|
154
|
-
expect do
|
155
|
-
group.run
|
156
|
-
end.to raise_error(/undefined method `metadata'/)
|
157
158
|
end
|
158
159
|
end
|
160
|
+
|
159
161
|
end
|
160
162
|
end
|
@@ -46,6 +46,30 @@ module RSpec::Core::Formatters
|
|
46
46
|
output.string.should =~ /(\s+)expected \"that\"\n\1 got \"this\"/m
|
47
47
|
end
|
48
48
|
|
49
|
+
context "with an exception class other than RSpec" do
|
50
|
+
it "does not show the error class" do
|
51
|
+
group.example("example name") { raise NameError.new('foo') }
|
52
|
+
run_all_and_dump_failures
|
53
|
+
output.string.should =~ /NameError/m
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
context "with a failed expectation (rspec-expectations)" do
|
58
|
+
it "does not show the error class" do
|
59
|
+
group.example("example name") { "this".should eq("that") }
|
60
|
+
run_all_and_dump_failures
|
61
|
+
output.string.should_not =~ /RSpec/m
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
context "with a failed message expectation (rspec-mocks)" do
|
66
|
+
it "does not show the error class" do
|
67
|
+
group.example("example name") { "this".should_receive("that") }
|
68
|
+
run_all_and_dump_failures
|
69
|
+
output.string.should_not =~ /RSpec/m
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
49
73
|
context 'for #share_examples_for' do
|
50
74
|
it 'outputs the name and location' do
|
51
75
|
|
@@ -153,7 +177,7 @@ module RSpec::Core::Formatters
|
|
153
177
|
formatter.dump_profile
|
154
178
|
filename = __FILE__.split(File::SEPARATOR).last
|
155
179
|
|
156
|
-
output.string.should =~ /#{filename}
|
180
|
+
output.string.should =~ /#{filename}\:#{__LINE__ - 21}/
|
157
181
|
end
|
158
182
|
end
|
159
183
|
end
|
@@ -219,11 +219,11 @@ a {
|
|
219
219
|
./spec/rspec/core/formatters/html_formatter_spec.rb:46
|
220
220
|
./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `chdir'
|
221
221
|
./spec/rspec/core/formatters/html_formatter_spec.rb:45</pre></div>
|
222
|
-
<pre class="ruby"><code><span class="linenum">
|
223
|
-
<span class="linenum">
|
224
|
-
<span class="offending"><span class="linenum">
|
225
|
-
<span class="linenum">
|
226
|
-
<span class="linenum">
|
222
|
+
<pre class="ruby"><code><span class="linenum">22</span> <span class="keyword">rescue</span> <span class="constant">Exception</span> <span class="punct">=></span> <span class="ident">e</span>
|
223
|
+
<span class="linenum">23</span> <span class="keyword">end</span>
|
224
|
+
<span class="offending"><span class="linenum">24</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>
|
225
|
+
<span class="linenum">25</span> <span class="keyword">end</span>
|
226
|
+
<span class="linenum">26</span> <span class="ident">throw</span> <span class="symbol">:pending_declared_in_example</span><span class="punct">,</span> <span class="ident">message</span></code></pre>
|
227
227
|
</div>
|
228
228
|
</dd>
|
229
229
|
</dl>
|
@@ -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('
|
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('
|
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,30 +207,24 @@ 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('
|
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:
|
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
221
|
./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
|
228
222
|
:1</pre></div>
|
229
|
-
<pre class="ruby"><code><span class="linenum">
|
230
|
-
<span class="linenum">
|
231
|
-
<span class="offending"><span class="linenum">
|
232
|
-
<span class="linenum">
|
233
|
-
<span class="linenum">
|
223
|
+
<pre class="ruby"><code><span class="linenum">22</span> <span class="keyword">rescue</span> <span class="constant">Exception</span> <span class="punct">=></span> <span class="ident">e</span>
|
224
|
+
<span class="linenum">23</span> <span class="keyword">end</span>
|
225
|
+
<span class="offending"><span class="linenum">24</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>
|
226
|
+
<span class="linenum">25</span> <span class="keyword">end</span>
|
227
|
+
<span class="linenum">26</span> <span class="ident">throw</span> <span class="symbol">:pending_declared_in_example</span><span class="punct">,</span> <span class="ident">message</span></code></pre>
|
234
228
|
</div>
|
235
229
|
</dd>
|
236
230
|
</dl>
|
@@ -238,7 +232,7 @@ a {
|
|
238
232
|
<div class="example_group">
|
239
233
|
<dl style="margin-left: 0px;">
|
240
234
|
<dt id="example_group_5">passing spec</dt>
|
241
|
-
<script type="text/javascript">moveProgressBar('
|
235
|
+
<script type="text/javascript">moveProgressBar('57.1');</script>
|
242
236
|
<dd class="spec passed"><span class="passed_spec_name">passes</span></dd>
|
243
237
|
</dl>
|
244
238
|
</div>
|
@@ -246,7 +240,7 @@ a {
|
|
246
240
|
<dl style="margin-left: 0px;">
|
247
241
|
<dt id="example_group_6">failing spec</dt>
|
248
242
|
<script type="text/javascript">makeRed('example_group_6');</script>
|
249
|
-
<script type="text/javascript">moveProgressBar('
|
243
|
+
<script type="text/javascript">moveProgressBar('71.4');</script>
|
250
244
|
<dd class="spec failed">
|
251
245
|
<span class="failed_spec_name">fails</span>
|
252
246
|
<div class="failure" id="failure_0">
|
@@ -256,18 +250,13 @@ expected 2
|
|
256
250
|
|
257
251
|
(compared using ==)
|
258
252
|
</pre></div>
|
259
|
-
<div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:
|
260
|
-
./spec/spec_helper.rb:31:in `run'
|
253
|
+
<div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:33
|
261
254
|
./spec/rspec/core/formatters/html_formatter_spec.rb:24
|
262
255
|
./spec/rspec/core/formatters/html_formatter_spec.rb:46
|
263
256
|
./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `open'
|
264
257
|
./spec/rspec/core/formatters/html_formatter_spec.rb:46
|
265
258
|
./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `chdir'
|
266
259
|
./spec/rspec/core/formatters/html_formatter_spec.rb:45
|
267
|
-
./spec/spec_helper.rb:82
|
268
|
-
./spec/spec_helper.rb:54:in `instance_eval'
|
269
|
-
./spec/spec_helper.rb:54:in `sandboxed'
|
270
|
-
./spec/spec_helper.rb:82
|
271
260
|
:1</pre></div>
|
272
261
|
<pre class="ruby"><code><span class="linenum">27</span> <span class="keyword">end</span>
|
273
262
|
<span class="linenum">28</span>
|
@@ -277,8 +266,32 @@ expected 2
|
|
277
266
|
</dd>
|
278
267
|
</dl>
|
279
268
|
</div>
|
269
|
+
<div class="example_group">
|
270
|
+
<dl style="margin-left: 0px;">
|
271
|
+
<dt id="example_group_7">a failing spec with odd backtraces</dt>
|
272
|
+
<script type="text/javascript">makeRed('example_group_7');</script>
|
273
|
+
<script type="text/javascript">moveProgressBar('85.7');</script>
|
274
|
+
<dd class="spec failed">
|
275
|
+
<span class="failed_spec_name">fails with a backtrace that has no file</span>
|
276
|
+
<div class="failure" id="failure_0">
|
277
|
+
<div class="message"><pre>foo</pre></div>
|
278
|
+
<div class="backtrace"><pre>(erb):1</pre></div>
|
279
|
+
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for (erb)</span></code></pre>
|
280
|
+
</div>
|
281
|
+
</dd>
|
282
|
+
<script type="text/javascript">moveProgressBar('100.0');</script>
|
283
|
+
<dd class="spec failed">
|
284
|
+
<span class="failed_spec_name">fails with a backtrace containing an erb file</span>
|
285
|
+
<div class="failure" id="failure_0">
|
286
|
+
<div class="message"><pre>#<Class:01x11fceed></pre></div>
|
287
|
+
<div class="backtrace"><pre>/foo.html.erb:1:in `<main>': foo (RuntimeError)</pre></div>
|
288
|
+
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
|
289
|
+
</div>
|
290
|
+
</dd>
|
291
|
+
</dl>
|
292
|
+
</div>
|
280
293
|
<script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>x seconds</strong>";</script>
|
281
|
-
<script type="text/javascript">document.getElementById('totals').innerHTML = "
|
294
|
+
<script type="text/javascript">document.getElementById('totals').innerHTML = "7 examples, 4 failures, 2 pending";</script>
|
282
295
|
</div>
|
283
296
|
</div>
|
284
297
|
</body>
|
@@ -219,11 +219,11 @@ a {
|
|
219
219
|
./spec/rspec/core/formatters/html_formatter_spec.rb:46
|
220
220
|
./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `chdir'
|
221
221
|
./spec/rspec/core/formatters/html_formatter_spec.rb:45</pre></div>
|
222
|
-
<pre class="ruby"><code><span class="linenum">
|
223
|
-
<span class="linenum">
|
224
|
-
<span class="offending"><span class="linenum">
|
225
|
-
<span class="linenum">
|
226
|
-
<span class="linenum">
|
222
|
+
<pre class="ruby"><code><span class="linenum">22</span> <span class="keyword">rescue</span> <span class="constant">Exception</span> <span class="punct">=></span> <span class="ident">e</span>
|
223
|
+
<span class="linenum">23</span> <span class="keyword">end</span>
|
224
|
+
<span class="offending"><span class="linenum">24</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>
|
225
|
+
<span class="linenum">25</span> <span class="keyword">end</span>
|
226
|
+
<span class="linenum">26</span> <span class="ident">throw</span> <span class="symbol">:pending_declared_in_example</span><span class="punct">,</span> <span class="ident">message</span></code></pre>
|
227
227
|
</div>
|
228
228
|
</dd>
|
229
229
|
</dl>
|
@@ -219,11 +219,11 @@ a {
|
|
219
219
|
./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `block (4 levels) in <module:Formatters>'
|
220
220
|
./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `chdir'
|
221
221
|
./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `block (3 levels) in <module:Formatters>'</pre></div>
|
222
|
-
<pre class="ruby"><code><span class="linenum">
|
223
|
-
<span class="linenum">
|
224
|
-
<span class="offending"><span class="linenum">
|
225
|
-
<span class="linenum">
|
226
|
-
<span class="linenum">
|
222
|
+
<pre class="ruby"><code><span class="linenum">22</span> <span class="keyword">rescue</span> <span class="constant">Exception</span> <span class="punct">=></span> <span class="ident">e</span>
|
223
|
+
<span class="linenum">23</span> <span class="keyword">end</span>
|
224
|
+
<span class="offending"><span class="linenum">24</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>
|
225
|
+
<span class="linenum">25</span> <span class="keyword">end</span>
|
226
|
+
<span class="linenum">26</span> <span class="ident">throw</span> <span class="symbol">:pending_declared_in_example</span><span class="punct">,</span> <span class="ident">message</span></code></pre>
|
227
227
|
</div>
|
228
228
|
</dd>
|
229
229
|
</dl>
|
@@ -219,11 +219,11 @@ a {
|
|
219
219
|
./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `block (4 levels) in <module:Formatters>'
|
220
220
|
./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `chdir'
|
221
221
|
./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `block (3 levels) in <module:Formatters>'</pre></div>
|
222
|
-
<pre class="ruby"><code><span class="linenum">
|
223
|
-
<span class="linenum">
|
224
|
-
<span class="offending"><span class="linenum">
|
225
|
-
<span class="linenum">
|
226
|
-
<span class="linenum">
|
222
|
+
<pre class="ruby"><code><span class="linenum">22</span> <span class="keyword">rescue</span> <span class="constant">Exception</span> <span class="punct">=></span> <span class="ident">e</span>
|
223
|
+
<span class="linenum">23</span> <span class="keyword">end</span>
|
224
|
+
<span class="offending"><span class="linenum">24</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>
|
225
|
+
<span class="linenum">25</span> <span class="keyword">end</span>
|
226
|
+
<span class="linenum">26</span> <span class="ident">throw</span> <span class="symbol">:pending_declared_in_example</span><span class="punct">,</span> <span class="ident">message</span></code></pre>
|
227
227
|
</div>
|
228
228
|
</dd>
|
229
229
|
</dl>
|
@@ -40,13 +40,13 @@ module RSpec
|
|
40
40
|
|
41
41
|
# Uncomment this group temporarily in order to overwrite the expected
|
42
42
|
# with actual. Use with care!!!
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
43
|
+
describe "file generator", :if => ENV['GENERATE'] do
|
44
|
+
it "generates a new comparison file" do
|
45
|
+
Dir.chdir(root) do
|
46
|
+
File.open(expected_file, 'w') {|io| io.write(generated_html)}
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
50
|
|
51
51
|
def extract_backtrace_from(doc)
|
52
52
|
backtrace = doc.search("div.backtrace").
|
@@ -212,18 +212,18 @@ a {
|
|
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><a href="txmt://open?url=file:///Users/
|
216
|
-
<a href="txmt://open?url=file:///Users/
|
217
|
-
<a href="txmt://open?url=file:///Users/
|
218
|
-
<a href="txmt://open?url=file:///Users/
|
219
|
-
<a href="txmt://open?url=file:///Users/
|
220
|
-
<a href="txmt://open?url=file:///Users/
|
221
|
-
<a href="txmt://open?url=file:///Users/
|
222
|
-
<pre class="ruby"><code><span class="linenum">
|
223
|
-
<span class="linenum">
|
224
|
-
<span class="offending"><span class="linenum">
|
225
|
-
<span class="linenum">
|
226
|
-
<span class="linenum">
|
215
|
+
<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
|
+
<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>
|
217
|
+
<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>
|
218
|
+
<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'
|
219
|
+
<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>
|
220
|
+
<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'
|
221
|
+
<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>
|
222
|
+
<pre class="ruby"><code><span class="linenum">22</span> <span class="keyword">rescue</span> <span class="constant">Exception</span> <span class="punct">=></span> <span class="ident">e</span>
|
223
|
+
<span class="linenum">23</span> <span class="keyword">end</span>
|
224
|
+
<span class="offending"><span class="linenum">24</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>
|
225
|
+
<span class="linenum">25</span> <span class="keyword">end</span>
|
226
|
+
<span class="linenum">26</span> <span class="ident">throw</span> <span class="symbol">:pending_declared_in_example</span><span class="punct">,</span> <span class="ident">message</span></code></pre>
|
227
227
|
</div>
|
228
228
|
</dd>
|
229
229
|
</dl>
|
@@ -249,13 +249,13 @@ expected 2
|
|
249
249
|
|
250
250
|
(compared using ==)
|
251
251
|
</pre></div>
|
252
|
-
<div class="backtrace"><pre><a href="txmt://open?url=file:///Users/
|
253
|
-
<a href="txmt://open?url=file:///Users/
|
254
|
-
<a href="txmt://open?url=file:///Users/
|
255
|
-
<a href="txmt://open?url=file:///Users/
|
256
|
-
<a href="txmt://open?url=file:///Users/
|
257
|
-
<a href="txmt://open?url=file:///Users/
|
258
|
-
<a href="txmt://open?url=file:///Users/
|
252
|
+
<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>
|
253
|
+
<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>
|
254
|
+
<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>
|
255
|
+
<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'
|
256
|
+
<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>
|
257
|
+
<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'
|
258
|
+
<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>
|
259
259
|
<pre class="ruby"><code><span class="linenum">27</span> <span class="keyword">end</span>
|
260
260
|
<span class="linenum">28</span>
|
261
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>
|