transpec 1.13.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +6 -0
- data/README.md +63 -22
- data/README.md.erb +55 -16
- data/lib/transpec/cli.rb +9 -9
- data/lib/transpec/commit_message.rb +2 -0
- data/lib/transpec/{configuration.rb → config.rb} +7 -6
- data/lib/transpec/converter.rb +57 -46
- data/lib/transpec/option_parser.rb +23 -25
- data/lib/transpec/rspec_version.rb +6 -0
- data/lib/transpec/spec_suite.rb +2 -6
- data/lib/transpec/syntax/example.rb +2 -15
- data/lib/transpec/syntax/example_group.rb +111 -9
- data/lib/transpec/syntax/have/dynamic_analysis.rb +1 -1
- data/lib/transpec/syntax/mixin/metadata.rb +29 -0
- data/lib/transpec/syntax/mixin/rspec_rails.rb +27 -0
- data/lib/transpec/syntax/rspec_configure.rb +14 -3
- data/lib/transpec/syntax/rspec_configure/{configuration_modification.rb → config_modification.rb} +18 -15
- data/lib/transpec/syntax/rspec_configure/framework.rb +7 -7
- data/lib/transpec/syntax/rspec_configure/mocks.rb +1 -1
- data/lib/transpec/version.rb +3 -3
- data/spec/transpec/commit_message_spec.rb +9 -1
- data/spec/transpec/{configuration_spec.rb → config_spec.rb} +19 -18
- data/spec/transpec/converter_spec.rb +245 -210
- data/spec/transpec/option_parser_spec.rb +27 -59
- data/spec/transpec/rspec_version_spec.rb +26 -0
- data/spec/transpec/syntax/example_group_spec.rb +277 -0
- data/spec/transpec/syntax/have_spec.rb +1 -1
- data/spec/transpec/syntax/rspec_configure_spec.rb +117 -0
- data/tasks/fixtures/guard/2.99.0/COMMIT_EDITMSG +3 -1
- data/tasks/fixtures/guard/3.0.0/COMMIT_EDITMSG +3 -1
- data/tasks/fixtures/mail/2.99.0/COMMIT_EDITMSG +3 -1
- data/tasks/fixtures/mail/3.0.0/COMMIT_EDITMSG +3 -1
- data/tasks/fixtures/twitter/2.99.0/COMMIT_EDITMSG +3 -1
- data/tasks/fixtures/twitter/3.0.0/COMMIT_EDITMSG +3 -1
- data/tasks/readme.rake +3 -2
- metadata +8 -6
@@ -5,9 +5,9 @@ require 'transpec/converter'
|
|
5
5
|
|
6
6
|
module Transpec
|
7
7
|
describe Converter do
|
8
|
-
subject(:converter) { Converter.new(spec_suite,
|
8
|
+
subject(:converter) { Converter.new(spec_suite, config, rspec_version) }
|
9
9
|
let(:spec_suite) { double('spec_suite', runtime_data: nil).as_null_object }
|
10
|
-
let(:
|
10
|
+
let(:config) { Config.new }
|
11
11
|
let(:rspec_version) { Transpec.required_rspec_version }
|
12
12
|
|
13
13
|
describe '#convert_file!' do
|
@@ -107,7 +107,7 @@ module Transpec
|
|
107
107
|
end
|
108
108
|
|
109
109
|
before do
|
110
|
-
|
110
|
+
config.convert_stub_with_hash_to_allow_to_receive_and_return = true
|
111
111
|
end
|
112
112
|
|
113
113
|
it 'converts all targets properly' do
|
@@ -122,7 +122,7 @@ module Transpec
|
|
122
122
|
|
123
123
|
context 'when the source has a monkey-patched expectation outside of example group context' do
|
124
124
|
before do
|
125
|
-
|
125
|
+
config.convert_should = true
|
126
126
|
converter.stub(:warn)
|
127
127
|
end
|
128
128
|
|
@@ -157,11 +157,11 @@ module Transpec
|
|
157
157
|
let(:should_object) { double('should_object', raise_error_matcher: raise_error_object).as_null_object }
|
158
158
|
let(:raise_error_object) { double('raise_error_object').as_null_object }
|
159
159
|
|
160
|
-
context 'when
|
161
|
-
before {
|
160
|
+
context 'when Config#convert_should? is true' do
|
161
|
+
before { config.convert_should = true }
|
162
162
|
|
163
|
-
context 'and
|
164
|
-
before {
|
163
|
+
context 'and Config#negative_form_of_to is "not_to"' do
|
164
|
+
before { config.negative_form_of_to = 'not_to' }
|
165
165
|
|
166
166
|
it 'invokes Should#expectize! with "not_to"' do
|
167
167
|
should_object.should_receive(:expectize!).with('not_to')
|
@@ -169,8 +169,8 @@ module Transpec
|
|
169
169
|
end
|
170
170
|
end
|
171
171
|
|
172
|
-
context 'and
|
173
|
-
before {
|
172
|
+
context 'and Config#negative_form_of_to is "to_not"' do
|
173
|
+
before { config.negative_form_of_to = 'to_not' }
|
174
174
|
|
175
175
|
it 'invokes Should#expectize! with "to_not"' do
|
176
176
|
should_object.should_receive(:expectize!).with('to_not')
|
@@ -179,8 +179,8 @@ module Transpec
|
|
179
179
|
end
|
180
180
|
end
|
181
181
|
|
182
|
-
context 'when
|
183
|
-
before {
|
182
|
+
context 'when Config#convert_should? is false' do
|
183
|
+
before { config.convert_should = false }
|
184
184
|
|
185
185
|
it 'does not invoke Should#expectize!' do
|
186
186
|
should_object.should_not_receive(:expectize!)
|
@@ -227,8 +227,8 @@ module Transpec
|
|
227
227
|
end
|
228
228
|
|
229
229
|
shared_examples 'converts to standard expecatations' do
|
230
|
-
context 'and
|
231
|
-
before {
|
230
|
+
context 'and Config#convert_should? is true' do
|
231
|
+
before { config.convert_should = true }
|
232
232
|
|
233
233
|
it 'invokes OnelinerShould#convert_have_items_to_standard_expect!' do
|
234
234
|
should_object.should_receive(:convert_have_items_to_standard_expect!)
|
@@ -236,8 +236,8 @@ module Transpec
|
|
236
236
|
end
|
237
237
|
end
|
238
238
|
|
239
|
-
context 'and
|
240
|
-
before {
|
239
|
+
context 'and Config#convert_should? is false' do
|
240
|
+
before { config.convert_should = false }
|
241
241
|
|
242
242
|
it 'invokes OnelinerShould#convert_have_items_to_standard_should!' do
|
243
243
|
should_object.should_receive(:convert_have_items_to_standard_should!)
|
@@ -246,21 +246,21 @@ module Transpec
|
|
246
246
|
end
|
247
247
|
end
|
248
248
|
|
249
|
-
context 'when
|
250
|
-
before {
|
249
|
+
context 'when Config#convert_oneliner? is true' do
|
250
|
+
before { config.convert_oneliner = true }
|
251
251
|
|
252
252
|
context 'and the #have matcher is conversion target' do
|
253
253
|
before do
|
254
254
|
have_object.stub(:conversion_target?).and_return(true)
|
255
255
|
end
|
256
256
|
|
257
|
-
context 'and
|
258
|
-
before {
|
257
|
+
context 'and Config#convert_have_items? is true' do
|
258
|
+
before { config.convert_have_items = true }
|
259
259
|
include_examples 'converts to standard expecatations'
|
260
260
|
end
|
261
261
|
|
262
|
-
context 'and
|
263
|
-
before {
|
262
|
+
context 'and Config#convert_have_items? is false' do
|
263
|
+
before { config.convert_have_items = false }
|
264
264
|
include_examples 'invokes OnelinerShould#expectize! if available'
|
265
265
|
end
|
266
266
|
end
|
@@ -270,33 +270,33 @@ module Transpec
|
|
270
270
|
have_object.stub(:conversion_target?).and_return(false)
|
271
271
|
end
|
272
272
|
|
273
|
-
context 'and
|
274
|
-
before {
|
273
|
+
context 'and Config#convert_have_items? is true' do
|
274
|
+
before { config.convert_have_items = true }
|
275
275
|
include_examples 'invokes OnelinerShould#expectize! if available'
|
276
276
|
end
|
277
277
|
|
278
|
-
context 'and
|
279
|
-
before {
|
278
|
+
context 'and Config#convert_have_items? is false' do
|
279
|
+
before { config.convert_have_items = false }
|
280
280
|
include_examples 'invokes OnelinerShould#expectize! if available'
|
281
281
|
end
|
282
282
|
end
|
283
283
|
end
|
284
284
|
|
285
|
-
context 'when
|
286
|
-
before {
|
285
|
+
context 'when Config#convert_oneliner? is false' do
|
286
|
+
before { config.convert_oneliner = false }
|
287
287
|
|
288
288
|
context 'and the #have matcher is conversion target' do
|
289
289
|
before do
|
290
290
|
have_object.stub(:conversion_target?).and_return(true)
|
291
291
|
end
|
292
292
|
|
293
|
-
context 'and
|
294
|
-
before {
|
293
|
+
context 'and Config#convert_have_items? is true' do
|
294
|
+
before { config.convert_have_items = true }
|
295
295
|
include_examples 'converts to standard expecatations'
|
296
296
|
end
|
297
297
|
|
298
|
-
context 'and
|
299
|
-
before {
|
298
|
+
context 'and Config#convert_have_items? is false' do
|
299
|
+
before { config.convert_have_items = false }
|
300
300
|
include_examples 'does nothing'
|
301
301
|
end
|
302
302
|
end
|
@@ -306,13 +306,13 @@ module Transpec
|
|
306
306
|
have_object.stub(:conversion_target?).and_return(false)
|
307
307
|
end
|
308
308
|
|
309
|
-
context 'and
|
310
|
-
before {
|
309
|
+
context 'and Config#convert_have_items? is true' do
|
310
|
+
before { config.convert_have_items = true }
|
311
311
|
include_examples 'does nothing'
|
312
312
|
end
|
313
313
|
|
314
|
-
context 'and
|
315
|
-
before {
|
314
|
+
context 'and Config#convert_have_items? is false' do
|
315
|
+
before { config.convert_have_items = false }
|
316
316
|
include_examples 'does nothing'
|
317
317
|
end
|
318
318
|
end
|
@@ -334,18 +334,18 @@ module Transpec
|
|
334
334
|
context 'when ShouldReceive#useless_expectation? returns true' do
|
335
335
|
before { should_receive_object.stub(:useless_expectation?).and_return(true) }
|
336
336
|
|
337
|
-
context 'and
|
338
|
-
before {
|
337
|
+
context 'and Config#convert_deprecated_method? is true' do
|
338
|
+
before { config.convert_deprecated_method = true }
|
339
339
|
|
340
|
-
context 'and
|
341
|
-
before {
|
340
|
+
context 'and Config#convert_stub? is true' do
|
341
|
+
before { config.convert_stub = true }
|
342
342
|
|
343
343
|
[true, false].each do |convert_should_receive|
|
344
|
-
context "and
|
345
|
-
before {
|
344
|
+
context "and Config#convert_should_receive? is #{convert_should_receive}" do
|
345
|
+
before { config.convert_should_receive = convert_should_receive }
|
346
346
|
|
347
|
-
context 'and
|
348
|
-
before {
|
347
|
+
context 'and Config#negative_form_of_to is "not_to"' do
|
348
|
+
before { config.negative_form_of_to = 'not_to' }
|
349
349
|
|
350
350
|
it 'invokes ShouldReceive#allowize_useless_expectation! with "not_to"' do
|
351
351
|
should_receive_object.should_receive(:allowize_useless_expectation!).with('not_to')
|
@@ -353,8 +353,8 @@ module Transpec
|
|
353
353
|
end
|
354
354
|
end
|
355
355
|
|
356
|
-
context 'and
|
357
|
-
before {
|
356
|
+
context 'and Config#negative_form_of_to is "to_not"' do
|
357
|
+
before { config.negative_form_of_to = 'to_not' }
|
358
358
|
|
359
359
|
it 'invokes ShouldReceive#allowize_useless_expectation! with "to_not"' do
|
360
360
|
should_receive_object.should_receive(:allowize_useless_expectation!).with('to_not')
|
@@ -365,12 +365,12 @@ module Transpec
|
|
365
365
|
end
|
366
366
|
end
|
367
367
|
|
368
|
-
context 'and
|
369
|
-
before {
|
368
|
+
context 'and Config#convert_stub? is false' do
|
369
|
+
before { config.convert_stub = false }
|
370
370
|
|
371
371
|
[true, false].each do |convert_should_receive|
|
372
|
-
context "and
|
373
|
-
before {
|
372
|
+
context "and Config#convert_should_receive? is #{convert_should_receive}" do
|
373
|
+
before { config.convert_should_receive = convert_should_receive }
|
374
374
|
|
375
375
|
it 'invokes ShouldReceive#stubize_useless_expectation!' do
|
376
376
|
should_receive_object.should_receive(:stubize_useless_expectation!)
|
@@ -381,18 +381,18 @@ module Transpec
|
|
381
381
|
end
|
382
382
|
end
|
383
383
|
|
384
|
-
context 'and
|
385
|
-
before {
|
384
|
+
context 'and Config#convert_deprecated_method? is false' do
|
385
|
+
before { config.convert_deprecated_method = false }
|
386
386
|
|
387
387
|
[true, false].each do |convert_stub|
|
388
|
-
context "and
|
389
|
-
before {
|
388
|
+
context "and Config#convert_stub? is #{convert_stub}" do
|
389
|
+
before { config.convert_stub = convert_stub }
|
390
390
|
|
391
|
-
context 'and
|
392
|
-
before {
|
391
|
+
context 'and Config#convert_should_receive? is true' do
|
392
|
+
before { config.convert_should_receive = true }
|
393
393
|
|
394
|
-
context 'and
|
395
|
-
before {
|
394
|
+
context 'and Config#negative_form_of_to is "not_to"' do
|
395
|
+
before { config.negative_form_of_to = 'not_to' }
|
396
396
|
|
397
397
|
it 'invokes ShouldReceive#expectize! with "not_to"' do
|
398
398
|
should_receive_object.should_receive(:expectize!).with('not_to')
|
@@ -400,8 +400,8 @@ module Transpec
|
|
400
400
|
end
|
401
401
|
end
|
402
402
|
|
403
|
-
context 'and
|
404
|
-
before {
|
403
|
+
context 'and Config#negative_form_of_to is "to_not"' do
|
404
|
+
before { config.negative_form_of_to = 'to_not' }
|
405
405
|
|
406
406
|
it 'invokes ShouldReceive#expectize! with "to_not"' do
|
407
407
|
should_receive_object.should_receive(:expectize!).with('to_not')
|
@@ -410,8 +410,8 @@ module Transpec
|
|
410
410
|
end
|
411
411
|
end
|
412
412
|
|
413
|
-
context 'and
|
414
|
-
before {
|
413
|
+
context 'and Config#convert_should_receive? is false' do
|
414
|
+
before { config.convert_should_receive = false }
|
415
415
|
|
416
416
|
include_examples 'does nothing'
|
417
417
|
end
|
@@ -423,19 +423,19 @@ module Transpec
|
|
423
423
|
context 'when ShouldReceive#useless_expectation? returns false' do
|
424
424
|
before { should_receive_object.stub(:useless_expectation?).and_return(false) }
|
425
425
|
|
426
|
-
context 'and
|
427
|
-
before {
|
426
|
+
context 'and Config#convert_should_receive? is true' do
|
427
|
+
before { config.convert_should_receive = true }
|
428
428
|
|
429
429
|
[true, false].each do |convert_deprecated_method|
|
430
|
-
context "and
|
431
|
-
before {
|
430
|
+
context "and Config#convert_deprecated_method? is #{convert_deprecated_method}" do
|
431
|
+
before { config.convert_deprecated_method = convert_deprecated_method }
|
432
432
|
|
433
433
|
[true, false].each do |convert_stub|
|
434
|
-
context "and
|
435
|
-
before {
|
434
|
+
context "and Config#convert_stub? is #{convert_stub}" do
|
435
|
+
before { config.convert_stub = convert_stub }
|
436
436
|
|
437
|
-
context 'and
|
438
|
-
before {
|
437
|
+
context 'and Config#negative_form_of_to is "not_to"' do
|
438
|
+
before { config.negative_form_of_to = 'not_to' }
|
439
439
|
|
440
440
|
it 'invokes ShouldReceive#expectize! with "not_to"' do
|
441
441
|
should_receive_object.should_receive(:expectize!).with('not_to')
|
@@ -443,8 +443,8 @@ module Transpec
|
|
443
443
|
end
|
444
444
|
end
|
445
445
|
|
446
|
-
context 'and
|
447
|
-
before {
|
446
|
+
context 'and Config#negative_form_of_to is "to_not"' do
|
447
|
+
before { config.negative_form_of_to = 'to_not' }
|
448
448
|
|
449
449
|
it 'invokes ShouldReceive#expectize! with "to_not"' do
|
450
450
|
should_receive_object.should_receive(:expectize!).with('to_not')
|
@@ -457,16 +457,16 @@ module Transpec
|
|
457
457
|
end
|
458
458
|
end
|
459
459
|
|
460
|
-
context 'and
|
461
|
-
before {
|
460
|
+
context 'and Config#convert_should_receive? is false' do
|
461
|
+
before { config.convert_should_receive = false }
|
462
462
|
|
463
463
|
[true, false].each do |convert_deprecated_method|
|
464
|
-
context "and
|
465
|
-
before {
|
464
|
+
context "and Config#convert_deprecated_method? is #{convert_deprecated_method}" do
|
465
|
+
before { config.convert_deprecated_method = convert_deprecated_method }
|
466
466
|
|
467
467
|
[true, false].each do |convert_stub|
|
468
|
-
context "and
|
469
|
-
before {
|
468
|
+
context "and Config#convert_stub? is #{convert_stub}" do
|
469
|
+
before { config.convert_stub = convert_stub }
|
470
470
|
|
471
471
|
include_examples 'does nothing'
|
472
472
|
end
|
@@ -522,11 +522,11 @@ module Transpec
|
|
522
522
|
end
|
523
523
|
end
|
524
524
|
|
525
|
-
context 'when
|
526
|
-
before {
|
525
|
+
context 'when Config#convert_stub? is true' do
|
526
|
+
before { config.convert_stub = true }
|
527
527
|
|
528
|
-
context 'and
|
529
|
-
before {
|
528
|
+
context 'and Config#convert_deprecated_method? is true' do
|
529
|
+
before { config.convert_deprecated_method = true }
|
530
530
|
|
531
531
|
context 'and MethodStub#hash_arg? is false' do
|
532
532
|
before { method_stub_object.stub(:hash_arg?).and_return(false) }
|
@@ -538,8 +538,8 @@ module Transpec
|
|
538
538
|
context 'and MethodStub#hash_arg? is true' do
|
539
539
|
before { method_stub_object.stub(:hash_arg?).and_return(true) }
|
540
540
|
|
541
|
-
context 'and
|
542
|
-
before {
|
541
|
+
context 'and Config#convert_stub_with_hash_to_allow_to_receive_and_return? is true' do
|
542
|
+
before { config.convert_stub_with_hash_to_allow_to_receive_and_return = true }
|
543
543
|
|
544
544
|
context 'and RSpecVersion#receive_messages_available? is true' do
|
545
545
|
before { rspec_version.stub(:receive_messages_available?).and_return(true) }
|
@@ -556,8 +556,8 @@ module Transpec
|
|
556
556
|
end
|
557
557
|
end
|
558
558
|
|
559
|
-
context 'and
|
560
|
-
before {
|
559
|
+
context 'and Config#convert_stub_with_hash_to_allow_to_receive_and_return? is false' do
|
560
|
+
before { config.convert_stub_with_hash_to_allow_to_receive_and_return = false }
|
561
561
|
|
562
562
|
context 'and RSpecVersion#receive_messages_available? is true' do
|
563
563
|
before { rspec_version.stub(:receive_messages_available?).and_return(true) }
|
@@ -576,9 +576,9 @@ module Transpec
|
|
576
576
|
end
|
577
577
|
end
|
578
578
|
|
579
|
-
context 'and
|
579
|
+
context 'and Config#convert_deprecated_method? is false' do
|
580
580
|
before do
|
581
|
-
|
581
|
+
config.convert_deprecated_method = false
|
582
582
|
method_stub_object.stub(:hash_arg?).and_return(false)
|
583
583
|
end
|
584
584
|
|
@@ -588,19 +588,19 @@ module Transpec
|
|
588
588
|
end
|
589
589
|
end
|
590
590
|
|
591
|
-
context 'when
|
592
|
-
before {
|
591
|
+
context 'when Config#convert_stub? is false' do
|
592
|
+
before { config.convert_stub = false }
|
593
593
|
|
594
|
-
context 'and
|
595
|
-
before {
|
594
|
+
context 'and Config#convert_deprecated_method? is true' do
|
595
|
+
before { config.convert_deprecated_method = true }
|
596
596
|
|
597
597
|
include_examples 'does not invoke MethodStub#allowize!'
|
598
598
|
include_examples 'invokes MethodStub#convert_deprecated_method!'
|
599
599
|
include_examples 'invokes MethodStub#remove_no_message_allowance!'
|
600
600
|
end
|
601
601
|
|
602
|
-
context 'and
|
603
|
-
before {
|
602
|
+
context 'and Config#convert_deprecated_method? is false' do
|
603
|
+
before { config.convert_deprecated_method = false }
|
604
604
|
|
605
605
|
include_examples 'does not invoke MethodStub#allowize!'
|
606
606
|
include_examples 'does not invoke MethodStub#convert_deprecated_method!'
|
@@ -612,8 +612,8 @@ module Transpec
|
|
612
612
|
describe '#process_double' do
|
613
613
|
let(:double_object) { double('double_object').as_null_object }
|
614
614
|
|
615
|
-
context 'when
|
616
|
-
before {
|
615
|
+
context 'when Config#convert_deprecated_method? is true' do
|
616
|
+
before { config.convert_deprecated_method = true }
|
617
617
|
|
618
618
|
it 'invokes Double#convert_to_double!' do
|
619
619
|
double_object.should_receive(:convert_to_double!)
|
@@ -621,8 +621,8 @@ module Transpec
|
|
621
621
|
end
|
622
622
|
end
|
623
623
|
|
624
|
-
context 'when
|
625
|
-
before {
|
624
|
+
context 'when Config#convert_deprecated_method? is false' do
|
625
|
+
before { config.convert_deprecated_method = false }
|
626
626
|
|
627
627
|
it 'does nothing' do
|
628
628
|
double_object.should_not_receive(:convert_to_double!)
|
@@ -634,11 +634,11 @@ module Transpec
|
|
634
634
|
describe '#process_operator' do
|
635
635
|
let(:operator_object) { double('operator_object').as_null_object }
|
636
636
|
|
637
|
-
context 'when
|
638
|
-
before {
|
637
|
+
context 'when Config#convert_should? is true' do
|
638
|
+
before { config.convert_should = true }
|
639
639
|
|
640
|
-
context 'and
|
641
|
-
before {
|
640
|
+
context 'and Config#parenthesize_matcher_arg is true' do
|
641
|
+
before { config.parenthesize_matcher_arg = true }
|
642
642
|
|
643
643
|
it 'invokes Operator#convert_operator! with true' do
|
644
644
|
operator_object.should_receive(:convert_operator!).with(true)
|
@@ -646,8 +646,8 @@ module Transpec
|
|
646
646
|
end
|
647
647
|
end
|
648
648
|
|
649
|
-
context 'and
|
650
|
-
before {
|
649
|
+
context 'and Config#parenthesize_matcher_arg is false' do
|
650
|
+
before { config.parenthesize_matcher_arg = false }
|
651
651
|
|
652
652
|
it 'invokes Should#expectize! with false as second argument' do
|
653
653
|
operator_object.should_receive(:convert_operator!).with(false)
|
@@ -680,8 +680,8 @@ module Transpec
|
|
680
680
|
end
|
681
681
|
end
|
682
682
|
|
683
|
-
context 'when
|
684
|
-
before {
|
683
|
+
context 'when Config#convert_should? is false' do
|
684
|
+
before { config.convert_should = false }
|
685
685
|
|
686
686
|
it 'does not invoke Operator#convert_operator!' do
|
687
687
|
operator_object.should_not_receive(:convert_operator!)
|
@@ -696,14 +696,14 @@ module Transpec
|
|
696
696
|
context 'when RSpecVersion#be_truthy_available? returns true' do
|
697
697
|
before { rspec_version.stub(:be_truthy_available?).and_return(true) }
|
698
698
|
|
699
|
-
context 'and
|
700
|
-
before {
|
699
|
+
context 'and Config#convert_deprecated_method? is true' do
|
700
|
+
before { config.convert_deprecated_method = true }
|
701
701
|
|
702
|
-
context 'and
|
703
|
-
before {
|
702
|
+
context 'and Config#boolean_matcher_type is :conditional' do
|
703
|
+
before { config.boolean_matcher_type = :conditional }
|
704
704
|
|
705
|
-
context 'and
|
706
|
-
before {
|
705
|
+
context 'and Config#form_of_be_falsey is "be_falsey"' do
|
706
|
+
before { config.form_of_be_falsey = 'be_falsey' }
|
707
707
|
|
708
708
|
it 'invokes BeBoolean#convert_to_conditional_matcher! with "be_falsey"' do
|
709
709
|
be_boolean_object.should_receive(:convert_to_conditional_matcher!).with('be_falsey')
|
@@ -711,8 +711,8 @@ module Transpec
|
|
711
711
|
end
|
712
712
|
end
|
713
713
|
|
714
|
-
context 'and
|
715
|
-
before {
|
714
|
+
context 'and Config#form_of_be_falsey is "be_falsy"' do
|
715
|
+
before { config.form_of_be_falsey = 'be_falsy' }
|
716
716
|
|
717
717
|
it 'invokes BeBoolean#convert_to_conditional_matcher! with "be_falsy"' do
|
718
718
|
be_boolean_object.should_receive(:convert_to_conditional_matcher!).with('be_falsy')
|
@@ -721,8 +721,8 @@ module Transpec
|
|
721
721
|
end
|
722
722
|
end
|
723
723
|
|
724
|
-
context 'and
|
725
|
-
before {
|
724
|
+
context 'and Config#boolean_matcher_type is :exact' do
|
725
|
+
before { config.boolean_matcher_type = :exact }
|
726
726
|
|
727
727
|
it 'invokes BeBoolean#convert_to_exact_matcher!' do
|
728
728
|
be_boolean_object.should_receive(:convert_to_exact_matcher!)
|
@@ -731,8 +731,8 @@ module Transpec
|
|
731
731
|
end
|
732
732
|
end
|
733
733
|
|
734
|
-
context 'and
|
735
|
-
before {
|
734
|
+
context 'and Config#convert_deprecated_method? is false' do
|
735
|
+
before { config.convert_deprecated_method = false }
|
736
736
|
|
737
737
|
it 'does nothing' do
|
738
738
|
be_boolean_object.should_not_receive(:convert_to_conditional_matcher!)
|
@@ -756,8 +756,8 @@ module Transpec
|
|
756
756
|
describe '#process_be_close' do
|
757
757
|
let(:be_close_object) { double('be_close_object').as_null_object }
|
758
758
|
|
759
|
-
context 'when
|
760
|
-
before {
|
759
|
+
context 'when Config#convert_deprecated_method? is true' do
|
760
|
+
before { config.convert_deprecated_method = true }
|
761
761
|
|
762
762
|
it 'invokes BeClose#convert_to_be_within!' do
|
763
763
|
be_close_object.should_receive(:convert_to_be_within!)
|
@@ -765,8 +765,8 @@ module Transpec
|
|
765
765
|
end
|
766
766
|
end
|
767
767
|
|
768
|
-
context 'when
|
769
|
-
before {
|
768
|
+
context 'when Config#convert_deprecated_method? is false' do
|
769
|
+
before { config.convert_deprecated_method = false }
|
770
770
|
|
771
771
|
it 'does nothing' do
|
772
772
|
be_close_object.should_not_receive(:convert_to_be_within!)
|
@@ -778,11 +778,11 @@ module Transpec
|
|
778
778
|
describe '#process_have' do
|
779
779
|
let(:have_object) { double('have_object').as_null_object }
|
780
780
|
|
781
|
-
context 'when
|
782
|
-
before {
|
781
|
+
context 'when Config#convert_have_items? is true' do
|
782
|
+
before { config.convert_have_items = true }
|
783
783
|
|
784
|
-
context 'and
|
785
|
-
before {
|
784
|
+
context 'and Config#parenthesize_matcher_arg is true' do
|
785
|
+
before { config.parenthesize_matcher_arg = true }
|
786
786
|
|
787
787
|
it 'invokes Have#convert_to_standard_expectation! with true' do
|
788
788
|
have_object.should_receive(:convert_to_standard_expectation!).with(true)
|
@@ -790,8 +790,8 @@ module Transpec
|
|
790
790
|
end
|
791
791
|
end
|
792
792
|
|
793
|
-
context 'and
|
794
|
-
before {
|
793
|
+
context 'and Config#parenthesize_matcher_arg is false' do
|
794
|
+
before { config.parenthesize_matcher_arg = false }
|
795
795
|
|
796
796
|
it 'invokes Have#convert_to_standard_expectation! with false' do
|
797
797
|
have_object.should_receive(:convert_to_standard_expectation!).with(false)
|
@@ -800,8 +800,8 @@ module Transpec
|
|
800
800
|
end
|
801
801
|
end
|
802
802
|
|
803
|
-
context 'when
|
804
|
-
before {
|
803
|
+
context 'when Config#convert_have_items? is false' do
|
804
|
+
before { config.convert_have_items = false }
|
805
805
|
|
806
806
|
it 'does not invoke Have#convert_to_standard_expectation!' do
|
807
807
|
have_object.should_not_receive(:convert_to_standard_expectation!)
|
@@ -813,8 +813,8 @@ module Transpec
|
|
813
813
|
describe '#process_hook' do
|
814
814
|
let(:hook_object) { double('hook_object').as_null_object }
|
815
815
|
|
816
|
-
context 'when
|
817
|
-
before {
|
816
|
+
context 'when Config#convert_hook_scope? is true' do
|
817
|
+
before { config.convert_hook_scope = true }
|
818
818
|
|
819
819
|
context 'when RSpecVersion#hook_scope_alias_available? returns true' do
|
820
820
|
before { rspec_version.stub(:hook_scope_alias_available?).and_return(true) }
|
@@ -835,8 +835,8 @@ module Transpec
|
|
835
835
|
end
|
836
836
|
end
|
837
837
|
|
838
|
-
context 'when
|
839
|
-
before {
|
838
|
+
context 'when Config#convert_hook_scope? is false' do
|
839
|
+
before { config.convert_hook_scope = false }
|
840
840
|
|
841
841
|
context 'when RSpecVersion#hook_scope_alias_available? returns true' do
|
842
842
|
before { rspec_version.stub(:hook_scope_alias_available?).and_return(true) }
|
@@ -852,8 +852,8 @@ module Transpec
|
|
852
852
|
describe '#process_raise_error' do
|
853
853
|
let(:raise_error_object) { double('raise_error_object').as_null_object }
|
854
854
|
|
855
|
-
context 'when
|
856
|
-
before {
|
855
|
+
context 'when Config#convert_deprecated_method? is true' do
|
856
|
+
before { config.convert_deprecated_method = true }
|
857
857
|
|
858
858
|
it 'invokes RaiseError#remove_error_specification_with_negative_expectation!' do
|
859
859
|
raise_error_object.should_receive(:remove_error_specification_with_negative_expectation!)
|
@@ -861,8 +861,8 @@ module Transpec
|
|
861
861
|
end
|
862
862
|
end
|
863
863
|
|
864
|
-
context 'when
|
865
|
-
before {
|
864
|
+
context 'when Config#convert_deprecated_method? is false' do
|
865
|
+
before { config.convert_deprecated_method = false }
|
866
866
|
|
867
867
|
it 'does nothing' do
|
868
868
|
raise_error_object.should_not_receive(:remove_error_specification_with_negative_expectation!)
|
@@ -874,8 +874,8 @@ module Transpec
|
|
874
874
|
describe '#process_its' do
|
875
875
|
let(:its_object) { double('its_object').as_null_object }
|
876
876
|
|
877
|
-
context 'when
|
878
|
-
before {
|
877
|
+
context 'when Config#convert_its? is true' do
|
878
|
+
before { config.convert_its = true }
|
879
879
|
|
880
880
|
it 'invokes Its#convert_to_describe_subject_it!' do
|
881
881
|
its_object.should_receive(:convert_to_describe_subject_it!)
|
@@ -883,8 +883,8 @@ module Transpec
|
|
883
883
|
end
|
884
884
|
end
|
885
885
|
|
886
|
-
context 'when
|
887
|
-
before {
|
886
|
+
context 'when Config#convert_its? is false' do
|
887
|
+
before { config.convert_its = false }
|
888
888
|
|
889
889
|
it 'does nothing' do
|
890
890
|
its_object.should_not_receive(:convert_to_describe_subject_it!)
|
@@ -906,8 +906,8 @@ module Transpec
|
|
906
906
|
context 'when RSpecVersion#rspec_2_99? returns true' do
|
907
907
|
before { rspec_version.stub(:rspec_2_99?).and_return(true) }
|
908
908
|
|
909
|
-
context 'and
|
910
|
-
before {
|
909
|
+
context 'and Config#convert_pending? returns true' do
|
910
|
+
before { config.convert_pending = true }
|
911
911
|
|
912
912
|
it 'invokes Example#convert_pending_to_skip!' do
|
913
913
|
example_object.should_receive(:convert_pending_to_skip!)
|
@@ -915,8 +915,8 @@ module Transpec
|
|
915
915
|
end
|
916
916
|
end
|
917
917
|
|
918
|
-
context 'and
|
919
|
-
before {
|
918
|
+
context 'and Config#convert_pending? returns false' do
|
919
|
+
before { config.convert_pending = false }
|
920
920
|
include_examples 'does nothing'
|
921
921
|
end
|
922
922
|
end
|
@@ -924,13 +924,13 @@ module Transpec
|
|
924
924
|
context 'when RSpecVersion#rspec_2_99? returns false' do
|
925
925
|
before { rspec_version.stub(:rspec_2_99?).and_return(false) }
|
926
926
|
|
927
|
-
context 'and
|
928
|
-
before {
|
927
|
+
context 'and Config#convert_pending? returns true' do
|
928
|
+
before { config.convert_pending = true }
|
929
929
|
include_examples 'does nothing'
|
930
930
|
end
|
931
931
|
|
932
|
-
context 'and
|
933
|
-
before {
|
932
|
+
context 'and Config#convert_pending? returns false' do
|
933
|
+
before { config.convert_pending = false }
|
934
934
|
include_examples 'does nothing'
|
935
935
|
end
|
936
936
|
end
|
@@ -949,8 +949,8 @@ module Transpec
|
|
949
949
|
context 'when RSpecVersion#rspec_2_99? returns true' do
|
950
950
|
before { rspec_version.stub(:rspec_2_99?).and_return(true) }
|
951
951
|
|
952
|
-
context 'and
|
953
|
-
before {
|
952
|
+
context 'and Config#convert_pending? returns true' do
|
953
|
+
before { config.convert_pending = true }
|
954
954
|
|
955
955
|
it 'invokes Example#convert_deprecated_syntax!' do
|
956
956
|
pending_object.should_receive(:convert_deprecated_syntax!)
|
@@ -958,8 +958,8 @@ module Transpec
|
|
958
958
|
end
|
959
959
|
end
|
960
960
|
|
961
|
-
context 'and
|
962
|
-
before {
|
961
|
+
context 'and Config#convert_pending? returns false' do
|
962
|
+
before { config.convert_pending = false }
|
963
963
|
include_examples 'does nothing'
|
964
964
|
end
|
965
965
|
end
|
@@ -967,13 +967,13 @@ module Transpec
|
|
967
967
|
context 'when RSpecVersion#rspec_2_99? returns false' do
|
968
968
|
before { rspec_version.stub(:rspec_2_99?).and_return(false) }
|
969
969
|
|
970
|
-
context 'and
|
971
|
-
before {
|
970
|
+
context 'and Config#convert_pending? returns true' do
|
971
|
+
before { config.convert_pending = true }
|
972
972
|
include_examples 'does nothing'
|
973
973
|
end
|
974
974
|
|
975
|
-
context 'and
|
976
|
-
before {
|
975
|
+
context 'and Config#convert_pending? returns false' do
|
976
|
+
before { config.convert_pending = false }
|
977
977
|
include_examples 'does nothing'
|
978
978
|
end
|
979
979
|
end
|
@@ -985,8 +985,8 @@ module Transpec
|
|
985
985
|
context 'when RSpecVersion#yielded_example_available? returns true' do
|
986
986
|
before { rspec_version.stub(:yielded_example_available?).and_return(true) }
|
987
987
|
|
988
|
-
context 'and
|
989
|
-
before {
|
988
|
+
context 'and Config#convert_deprecated_method? is true' do
|
989
|
+
before { config.convert_deprecated_method = true }
|
990
990
|
|
991
991
|
it 'invokes CurrentExample#convert!' do
|
992
992
|
current_example_object.should_receive(:convert!)
|
@@ -994,8 +994,8 @@ module Transpec
|
|
994
994
|
end
|
995
995
|
end
|
996
996
|
|
997
|
-
context 'and
|
998
|
-
before {
|
997
|
+
context 'and Config#convert_deprecated_method? is false' do
|
998
|
+
before { config.convert_deprecated_method = false }
|
999
999
|
|
1000
1000
|
it 'does nothing' do
|
1001
1001
|
current_example_object.should_not_receive(:convert!)
|
@@ -1007,8 +1007,8 @@ module Transpec
|
|
1007
1007
|
context 'when RSpecVersion#yielded_example_available? returns false' do
|
1008
1008
|
before { rspec_version.stub(:yielded_example_available?).and_return(false) }
|
1009
1009
|
|
1010
|
-
context 'and
|
1011
|
-
before {
|
1010
|
+
context 'and Config#convert_deprecated_method? is true' do
|
1011
|
+
before { config.convert_deprecated_method = true }
|
1012
1012
|
|
1013
1013
|
it 'does nothing' do
|
1014
1014
|
current_example_object.should_not_receive(:convert!)
|
@@ -1024,8 +1024,8 @@ module Transpec
|
|
1024
1024
|
context 'when RSpecVersion#non_should_matcher_protocol_available? returns true' do
|
1025
1025
|
before { rspec_version.stub(:non_should_matcher_protocol_available?).and_return(true) }
|
1026
1026
|
|
1027
|
-
context 'and
|
1028
|
-
before {
|
1027
|
+
context 'and Config#convert_deprecated_method? is true' do
|
1028
|
+
before { config.convert_deprecated_method = true }
|
1029
1029
|
|
1030
1030
|
it 'invokes MatcherDefinition#convert_deprecated_method!' do
|
1031
1031
|
matcher_definition.should_receive(:convert_deprecated_method!)
|
@@ -1033,8 +1033,8 @@ module Transpec
|
|
1033
1033
|
end
|
1034
1034
|
end
|
1035
1035
|
|
1036
|
-
context 'and
|
1037
|
-
before {
|
1036
|
+
context 'and Config#convert_deprecated_method? is false' do
|
1037
|
+
before { config.convert_deprecated_method = false }
|
1038
1038
|
|
1039
1039
|
it 'does nothing' do
|
1040
1040
|
matcher_definition.should_not_receive(:convert_deprecated_method!)
|
@@ -1046,8 +1046,8 @@ module Transpec
|
|
1046
1046
|
context 'when RSpecVersion#non_should_matcher_protocol_available? returns false' do
|
1047
1047
|
before { rspec_version.stub(:non_should_matcher_protocol_available?).and_return(false) }
|
1048
1048
|
|
1049
|
-
context 'and
|
1050
|
-
before {
|
1049
|
+
context 'and Config#convert_deprecated_method? is true' do
|
1050
|
+
before { config.convert_deprecated_method = true }
|
1051
1051
|
|
1052
1052
|
it 'does nothing' do
|
1053
1053
|
matcher_definition.should_not_receive(:convert_deprecated_method!)
|
@@ -1063,8 +1063,8 @@ module Transpec
|
|
1063
1063
|
context 'when RSpecVersion#non_monkey_patch_example_group_available? returns true' do
|
1064
1064
|
before { rspec_version.stub(:non_monkey_patch_example_group_available?).and_return(true) }
|
1065
1065
|
|
1066
|
-
context 'and
|
1067
|
-
before {
|
1066
|
+
context 'and Config#convert_example_group? is true' do
|
1067
|
+
before { config.convert_example_group = true }
|
1068
1068
|
|
1069
1069
|
it 'invokes ExampleGroup#convert_to_non_monkey_patch!' do
|
1070
1070
|
example_group.should_receive(:convert_to_non_monkey_patch!)
|
@@ -1072,8 +1072,8 @@ module Transpec
|
|
1072
1072
|
end
|
1073
1073
|
end
|
1074
1074
|
|
1075
|
-
context 'and
|
1076
|
-
before {
|
1075
|
+
context 'and Config#convert_example_group? is false' do
|
1076
|
+
before { config.convert_example_group = false }
|
1077
1077
|
|
1078
1078
|
it 'does nothing' do
|
1079
1079
|
example_group.should_not_receive(:convert_to_non_monkey_patch!)
|
@@ -1085,8 +1085,8 @@ module Transpec
|
|
1085
1085
|
context 'when RSpecVersion#non_monkey_patch_example_group_available? returns false' do
|
1086
1086
|
before { rspec_version.stub(:non_monkey_patch_example_group_available?).and_return(false) }
|
1087
1087
|
|
1088
|
-
context 'and
|
1089
|
-
before {
|
1088
|
+
context 'and Config#convert_example_group? is true' do
|
1089
|
+
before { config.convert_example_group = true }
|
1090
1090
|
|
1091
1091
|
it 'does nothing' do
|
1092
1092
|
example_group.should_not_receive(:convert_to_non_monkey_patch!)
|
@@ -1094,6 +1094,41 @@ module Transpec
|
|
1094
1094
|
end
|
1095
1095
|
end
|
1096
1096
|
end
|
1097
|
+
|
1098
|
+
context 'when RSpecVersion#implicit_spec_type_disablement_available? returns true' do
|
1099
|
+
before { rspec_version.stub(:implicit_spec_type_disablement_available?).and_return(true) }
|
1100
|
+
|
1101
|
+
context 'and Config#add_explicit_type_metadata_to_example_group? is true' do
|
1102
|
+
before { config.add_explicit_type_metadata_to_example_group = true }
|
1103
|
+
|
1104
|
+
it 'invokes ExampleGroup#add_explicit_type_metadata!' do
|
1105
|
+
example_group.should_receive(:add_explicit_type_metadata!)
|
1106
|
+
converter.process_example_group(example_group)
|
1107
|
+
end
|
1108
|
+
end
|
1109
|
+
|
1110
|
+
context 'and Config#add_explicit_type_metadata_to_example_group? is false' do
|
1111
|
+
before { config.add_explicit_type_metadata_to_example_group = false }
|
1112
|
+
|
1113
|
+
it 'does nothing' do
|
1114
|
+
example_group.should_not_receive(:add_explicit_type_metadata!)
|
1115
|
+
converter.process_example_group(example_group)
|
1116
|
+
end
|
1117
|
+
end
|
1118
|
+
end
|
1119
|
+
|
1120
|
+
context 'when RSpecVersion#implicit_spec_type_disablement_available? returns false' do
|
1121
|
+
before { rspec_version.stub(:implicit_spec_type_disablement_available?).and_return(false) }
|
1122
|
+
|
1123
|
+
context 'and Config#add_explicit_type_metadata_to_example_group? is true' do
|
1124
|
+
before { config.add_explicit_type_metadata_to_example_group = true }
|
1125
|
+
|
1126
|
+
it 'does nothing' do
|
1127
|
+
example_group.should_not_receive(:add_explicit_type_metadata!)
|
1128
|
+
converter.process_example_group(example_group)
|
1129
|
+
end
|
1130
|
+
end
|
1131
|
+
end
|
1097
1132
|
end
|
1098
1133
|
|
1099
1134
|
describe '#process_rspec_configure' do
|
@@ -1110,22 +1145,22 @@ module Transpec
|
|
1110
1145
|
rspec_version.stub(:rspec_2_99?).and_return(true)
|
1111
1146
|
end
|
1112
1147
|
|
1113
|
-
context 'and
|
1114
|
-
before {
|
1148
|
+
context 'and Config#convert_deprecated_method? returns true' do
|
1149
|
+
before { config.convert_deprecated_method = true }
|
1115
1150
|
|
1116
1151
|
context 'and SpecSuite#main_rspec_configure_node? returns true' do
|
1117
1152
|
before do
|
1118
1153
|
spec_suite.stub(:main_rspec_configure_node?).and_return(true)
|
1119
1154
|
end
|
1120
1155
|
|
1121
|
-
context 'and SpecSuite#need_to_modify_yield_receiver_...
|
1156
|
+
context 'and SpecSuite#need_to_modify_yield_receiver_..._config? return true' do
|
1122
1157
|
before do
|
1123
1158
|
spec_suite.stub(:need_to_modify_yield_receiver_to_any_instance_implementation_blocks_config?)
|
1124
1159
|
.and_return(true)
|
1125
1160
|
end
|
1126
1161
|
|
1127
|
-
context 'and
|
1128
|
-
before {
|
1162
|
+
context 'and Config#add_receiver_arg_to_any_instance_implementation_block? returns true' do
|
1163
|
+
before { config.add_receiver_arg_to_any_instance_implementation_block = true }
|
1129
1164
|
|
1130
1165
|
it 'invokes RSpecConfigure.mocks.yield_receiver_to_any_instance_implementation_blocks= with true' do
|
1131
1166
|
rspec_configure.mocks
|
@@ -1134,8 +1169,8 @@ module Transpec
|
|
1134
1169
|
end
|
1135
1170
|
end
|
1136
1171
|
|
1137
|
-
context 'and
|
1138
|
-
before {
|
1172
|
+
context 'and Config#add_receiver_arg_to_any_instance_implementation_block? returns false' do
|
1173
|
+
before { config.add_receiver_arg_to_any_instance_implementation_block = false }
|
1139
1174
|
|
1140
1175
|
it 'invokes RSpecConfigure.mocks.yield_receiver_to_any_instance_implementation_blocks= with false' do
|
1141
1176
|
rspec_configure.mocks
|
@@ -1146,14 +1181,14 @@ module Transpec
|
|
1146
1181
|
end
|
1147
1182
|
end
|
1148
1183
|
|
1149
|
-
context 'and SpecSuite#need_to_modify_yield_receiver_...
|
1184
|
+
context 'and SpecSuite#need_to_modify_yield_receiver_..._config? return false' do
|
1150
1185
|
before do
|
1151
1186
|
spec_suite.stub(:need_to_modify_yield_receiver_to_any_instance_implementation_blocks_config?)
|
1152
1187
|
.and_return(false)
|
1153
1188
|
end
|
1154
1189
|
|
1155
|
-
context 'and
|
1156
|
-
before {
|
1190
|
+
context 'and Config#add_receiver_arg_to_any_instance_implementation_block? returns true' do
|
1191
|
+
before { config.add_receiver_arg_to_any_instance_implementation_block = true }
|
1157
1192
|
|
1158
1193
|
it 'does not invoke RSpecConfigure.mocks.yield_receiver_to_any_instance_implementation_blocks=' do
|
1159
1194
|
rspec_configure.mocks.should_not_receive(:yield_receiver_to_any_instance_implementation_blocks=)
|
@@ -1167,8 +1202,8 @@ module Transpec
|
|
1167
1202
|
spec_suite.stub(:main_rspec_configure_node?).and_return(false)
|
1168
1203
|
end
|
1169
1204
|
|
1170
|
-
context 'and
|
1171
|
-
before {
|
1205
|
+
context 'and Config#add_receiver_arg_to_any_instance_implementation_block? returns true' do
|
1206
|
+
before { config.add_receiver_arg_to_any_instance_implementation_block = true }
|
1172
1207
|
|
1173
1208
|
it 'does not invoke RSpecConfigure.mocks.yield_receiver_to_any_instance_implementation_blocks=' do
|
1174
1209
|
rspec_configure.mocks.should_not_receive(:yield_receiver_to_any_instance_implementation_blocks=)
|
@@ -1178,8 +1213,8 @@ module Transpec
|
|
1178
1213
|
end
|
1179
1214
|
end
|
1180
1215
|
|
1181
|
-
context 'and
|
1182
|
-
before {
|
1216
|
+
context 'and Config#convert_deprecated_method? returns false' do
|
1217
|
+
before { config.convert_deprecated_method = false }
|
1183
1218
|
|
1184
1219
|
it 'does not invoke RSpecConfigure.mocks.yield_receiver_to_any_instance_implementation_blocks=' do
|
1185
1220
|
rspec_configure.mocks.should_not_receive(:yield_receiver_to_any_instance_implementation_blocks=)
|
@@ -1202,8 +1237,8 @@ module Transpec
|
|
1202
1237
|
context 'when RSpecVersion#non_monkey_patch_example_group_available? returns true' do
|
1203
1238
|
before { rspec_version.stub(:non_monkey_patch_example_group_available?).and_return(true) }
|
1204
1239
|
|
1205
|
-
context 'and
|
1206
|
-
before {
|
1240
|
+
context 'and Config#convert_example_group? is true' do
|
1241
|
+
before { config.convert_example_group = true }
|
1207
1242
|
|
1208
1243
|
it 'invokes RSpecConfigure#expose_dsl_globally= with false' do
|
1209
1244
|
rspec_configure.should_receive(:expose_dsl_globally=).with(false)
|
@@ -1211,8 +1246,8 @@ module Transpec
|
|
1211
1246
|
end
|
1212
1247
|
end
|
1213
1248
|
|
1214
|
-
context 'and
|
1215
|
-
before {
|
1249
|
+
context 'and Config#convert_example_group? is false' do
|
1250
|
+
before { config.convert_example_group = false }
|
1216
1251
|
|
1217
1252
|
it 'does nothing' do
|
1218
1253
|
rspec_configure.should_not_receive(:expose_dsl_globally=)
|
@@ -1224,8 +1259,8 @@ module Transpec
|
|
1224
1259
|
context 'when RSpecVersion#non_monkey_patch_example_group_available? returns false' do
|
1225
1260
|
before { rspec_version.stub(:non_monkey_patch_example_group_available?).and_return(false) }
|
1226
1261
|
|
1227
|
-
context 'and
|
1228
|
-
before {
|
1262
|
+
context 'and Config#convert_example_group? is true' do
|
1263
|
+
before { config.convert_example_group = true }
|
1229
1264
|
|
1230
1265
|
it 'does nothing' do
|
1231
1266
|
rspec_configure.should_not_receive(:expose_dsl_globally=)
|
@@ -1238,8 +1273,8 @@ module Transpec
|
|
1238
1273
|
describe '#process_useless_and_return' do
|
1239
1274
|
let(:messaging_host) { double('messaging host').as_null_object }
|
1240
1275
|
|
1241
|
-
context 'when
|
1242
|
-
before {
|
1276
|
+
context 'when Config#convert_deprecated_method? returns true' do
|
1277
|
+
before { config.convert_deprecated_method = true }
|
1243
1278
|
|
1244
1279
|
it 'invokes #remove_useless_and_return!' do
|
1245
1280
|
messaging_host.should_receive(:remove_useless_and_return!)
|
@@ -1247,8 +1282,8 @@ module Transpec
|
|
1247
1282
|
end
|
1248
1283
|
end
|
1249
1284
|
|
1250
|
-
context 'when
|
1251
|
-
before {
|
1285
|
+
context 'when Config#convert_deprecated_method? returns false' do
|
1286
|
+
before { config.convert_deprecated_method = false }
|
1252
1287
|
|
1253
1288
|
it 'does nothing' do
|
1254
1289
|
messaging_host.should_not_receive(:remove_useless_and_return!)
|
@@ -1265,11 +1300,11 @@ module Transpec
|
|
1265
1300
|
rspec_version.stub(:rspec_2_99?).and_return(true)
|
1266
1301
|
end
|
1267
1302
|
|
1268
|
-
context 'and
|
1269
|
-
before {
|
1303
|
+
context 'and Config#convert_deprecated_method? returns true' do
|
1304
|
+
before { config.convert_deprecated_method = true }
|
1270
1305
|
|
1271
|
-
context 'and
|
1272
|
-
before {
|
1306
|
+
context 'and Config#add_receiver_arg_to_any_instance_implementation_block? returns true' do
|
1307
|
+
before { config.add_receiver_arg_to_any_instance_implementation_block = true }
|
1273
1308
|
|
1274
1309
|
it 'invokes #add_receiver_arg_to_any_instance_implementation_block!' do
|
1275
1310
|
messaging_host.should_receive(:add_receiver_arg_to_any_instance_implementation_block!)
|
@@ -1277,8 +1312,8 @@ module Transpec
|
|
1277
1312
|
end
|
1278
1313
|
end
|
1279
1314
|
|
1280
|
-
context 'and
|
1281
|
-
before {
|
1315
|
+
context 'and Config#add_receiver_arg_to_any_instance_implementation_block? returns false' do
|
1316
|
+
before { config.add_receiver_arg_to_any_instance_implementation_block = false }
|
1282
1317
|
|
1283
1318
|
it 'does nothing' do
|
1284
1319
|
messaging_host.should_not_receive(:add_instance_arg_to_any_instance_implementation_block!)
|
@@ -1287,11 +1322,11 @@ module Transpec
|
|
1287
1322
|
end
|
1288
1323
|
end
|
1289
1324
|
|
1290
|
-
context 'and
|
1291
|
-
before {
|
1325
|
+
context 'and Config#convert_deprecated_method? returns false' do
|
1326
|
+
before { config.convert_deprecated_method = false }
|
1292
1327
|
|
1293
|
-
context 'and
|
1294
|
-
before {
|
1328
|
+
context 'and Config#add_receiver_arg_to_any_instance_implementation_block? returns true' do
|
1329
|
+
before { config.add_receiver_arg_to_any_instance_implementation_block = true }
|
1295
1330
|
|
1296
1331
|
it 'does nothing' do
|
1297
1332
|
messaging_host.should_not_receive(:add_instance_arg_to_any_instance_implementation_block!)
|