transpec 2.3.8 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +11 -0
- data/CHANGELOG.md +8 -1
- data/Gemfile +0 -2
- data/Guardfile +2 -2
- data/README.md +16 -16
- data/README.md.erb +9 -9
- data/lib/transpec/cli.rb +12 -13
- data/lib/transpec/config.rb +1 -1
- data/lib/transpec/converter.rb +11 -7
- data/lib/transpec/dynamic_analyzer.rb +2 -2
- data/lib/transpec/git.rb +5 -4
- data/lib/transpec/option_parser.rb +8 -8
- data/lib/transpec/processed_source.rb +4 -7
- data/lib/transpec/project.rb +18 -5
- data/lib/transpec/spec_suite.rb +9 -6
- data/lib/transpec/syntax.rb +13 -5
- data/lib/transpec/syntax/method_stub.rb +1 -1
- data/lib/transpec/syntax/mixin/matcher_owner.rb +3 -1
- data/lib/transpec/syntax/mixin/owned_matcher.rb +4 -2
- data/lib/transpec/syntax/mixin/rspec_rails.rb +1 -1
- data/lib/transpec/syntax/oneliner_should.rb +1 -1
- data/lib/transpec/syntax/operator.rb +4 -2
- data/lib/transpec/syntax/rspec_configure.rb +1 -1
- data/lib/transpec/version.rb +3 -3
- data/spec/spec_helper.rb +1 -4
- data/spec/support/shared_context.rb +6 -1
- data/spec/transpec/config_spec.rb +1 -1
- data/spec/transpec/converter_spec.rb +10 -5
- data/spec/transpec/dynamic_analyzer_spec.rb +6 -6
- data/spec/transpec/git_spec.rb +22 -33
- data/spec/transpec/option_parser_spec.rb +4 -4
- data/spec/transpec/project_spec.rb +118 -7
- data/spec/transpec/spec_suite_spec.rb +4 -3
- data/spec/transpec/syntax/current_example_spec.rb +2 -2
- data/spec/transpec/syntax/double_spec.rb +1 -1
- data/spec/transpec/syntax/example_group_spec.rb +309 -164
- data/spec/transpec/syntax/example_spec.rb +1 -1
- data/spec/transpec/syntax/have_spec.rb +1 -1
- data/spec/transpec/syntax/its_spec.rb +1 -1
- data/spec/transpec/syntax/method_stub_spec.rb +7 -10
- data/spec/transpec/syntax/oneliner_should_spec.rb +1 -1
- data/spec/transpec/syntax/pending_spec.rb +1 -1
- data/spec/transpec/syntax/rspec_configure_spec.rb +66 -57
- data/tasks/readme.rake +12 -3
- metadata +3 -3
@@ -9,9 +9,10 @@ module Transpec
|
|
9
9
|
include FileHelper
|
10
10
|
include_context 'isolated environment'
|
11
11
|
|
12
|
-
subject(:spec_suite) { SpecSuite.new(
|
12
|
+
subject(:spec_suite) { SpecSuite.new(project, target_paths, runtime_data) }
|
13
|
+
let(:project) { Project.new }
|
14
|
+
let(:target_paths) { [] }
|
13
15
|
let(:runtime_data) { nil }
|
14
|
-
let(:base_paths) { [] }
|
15
16
|
|
16
17
|
describe '#need_to_modify_yield_receiver_to_any_instance_implementation_blocks_config?' do
|
17
18
|
subject do
|
@@ -79,7 +80,7 @@ module Transpec
|
|
79
80
|
end
|
80
81
|
|
81
82
|
context 'with runtime information' do
|
82
|
-
let(:runtime_data) { Transpec::DynamicAnalyzer.new(silent: true).analyze(
|
83
|
+
let(:runtime_data) { Transpec::DynamicAnalyzer.new(silent: true).analyze(target_paths) }
|
83
84
|
|
84
85
|
let(:main_rspec_configure_node) do
|
85
86
|
spec_suite.specs.each do |spec|
|
@@ -20,7 +20,7 @@ module Transpec
|
|
20
20
|
end
|
21
21
|
|
22
22
|
let(:current_example_object) do
|
23
|
-
CurrentExample.new(target_node,
|
23
|
+
CurrentExample.new(target_node, runtime_data)
|
24
24
|
end
|
25
25
|
|
26
26
|
subject { current_example_object.conversion_target? }
|
@@ -229,7 +229,7 @@ module Transpec
|
|
229
229
|
|
230
230
|
let(:current_example_objects) do
|
231
231
|
ast.each_node.each_with_object([]) do |node, objects|
|
232
|
-
current_example_object = CurrentExample.new(node,
|
232
|
+
current_example_object = CurrentExample.new(node, runtime_data, project, source_rewriter)
|
233
233
|
objects << current_example_object if current_example_object.conversion_target?
|
234
234
|
end
|
235
235
|
end
|
@@ -3,11 +3,12 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
require 'transpec/syntax/example_group'
|
5
5
|
require 'ast'
|
6
|
+
require 'active_support/core_ext/string/strip.rb'
|
6
7
|
|
7
8
|
module Transpec
|
8
9
|
class Syntax
|
9
10
|
describe ExampleGroup do
|
10
|
-
include ::AST::Sexp
|
11
|
+
include ::AST::Sexp, FileHelper
|
11
12
|
include_context 'parsed objects'
|
12
13
|
include_context 'syntax object', ExampleGroup, :example_group
|
13
14
|
|
@@ -93,7 +94,7 @@ module Transpec
|
|
93
94
|
shared_context 'multiple #describes' do
|
94
95
|
before do
|
95
96
|
ast.each_node do |node|
|
96
|
-
example_group = described_class.new(node,
|
97
|
+
example_group = described_class.new(node, runtime_data, project, source_rewriter)
|
97
98
|
next unless example_group.conversion_target?
|
98
99
|
example_group.convert_to_non_monkey_patch!
|
99
100
|
end
|
@@ -281,250 +282,305 @@ module Transpec
|
|
281
282
|
end
|
282
283
|
|
283
284
|
describe '#add_explicit_type_metadata!' do
|
284
|
-
|
285
|
-
|
286
|
-
|
285
|
+
context 'in rspec-rails project' do
|
286
|
+
before do
|
287
|
+
example_group.stub(:rspec_rails?).and_return(true)
|
288
|
+
example_group.add_explicit_type_metadata!
|
289
|
+
end
|
287
290
|
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
291
|
+
context 'when it is in top level scope' do
|
292
|
+
context "and expression `describe 'something' do ... end`" do
|
293
|
+
let(:source) do
|
294
|
+
<<-END
|
295
|
+
describe 'something' do
|
296
|
+
end
|
297
|
+
END
|
298
|
+
end
|
299
|
+
|
300
|
+
{
|
301
|
+
'controllers' => :controller,
|
302
|
+
'helpers' => :helper,
|
303
|
+
'mailers' => :mailer,
|
304
|
+
'models' => :model,
|
305
|
+
'requests' => :request,
|
306
|
+
'integration' => :request,
|
307
|
+
'api' => :request,
|
308
|
+
'routing' => :routing,
|
309
|
+
'views' => :view,
|
310
|
+
'features' => :feature
|
311
|
+
}.each do |directory, type|
|
312
|
+
context "and the file path is \"spec/#{directory}/some_spec.rb\"" do
|
313
|
+
let(:source_path) { "spec/#{directory}/some_spec.rb" }
|
314
|
+
|
315
|
+
let(:expected_source) do
|
316
|
+
<<-END
|
317
|
+
describe 'something', :type => #{type.inspect} do
|
318
|
+
end
|
319
|
+
END
|
320
|
+
end
|
321
|
+
|
322
|
+
it "adds metadata \":type => #{type.inspect}\"" do
|
323
|
+
rewritten_source.should == expected_source
|
324
|
+
end
|
325
|
+
|
326
|
+
it "adds record `describe 'some #{type}' { }` " \
|
327
|
+
"-> `describe 'some #{type}', :type => #{type.inspect} { }`" do
|
328
|
+
record.old_syntax.should == "describe 'some #{type}' { }"
|
329
|
+
record.new_syntax.should == "describe 'some #{type}', :type => #{type.inspect} { }"
|
330
|
+
end
|
331
|
+
end
|
332
|
+
end
|
296
333
|
|
297
|
-
|
298
|
-
|
299
|
-
'helpers' => :helper,
|
300
|
-
'mailers' => :mailer,
|
301
|
-
'models' => :model,
|
302
|
-
'requests' => :request,
|
303
|
-
'integration' => :request,
|
304
|
-
'api' => :request,
|
305
|
-
'routing' => :routing,
|
306
|
-
'views' => :view,
|
307
|
-
'features' => :feature
|
308
|
-
}.each do |directory, type|
|
309
|
-
context "and the file path is \"spec/#{directory}/some_spec.rb\"" do
|
310
|
-
let(:source_path) { "spec/#{directory}/some_spec.rb" }
|
334
|
+
context 'and the file path is "spec/contollers/some_namespace/some_spec.rb"' do
|
335
|
+
let(:source_path) { 'spec/controllers/some_namespace/some_spec.rb' }
|
311
336
|
|
312
337
|
let(:expected_source) do
|
313
338
|
<<-END
|
314
|
-
|
315
|
-
|
339
|
+
describe 'something', :type => :controller do
|
340
|
+
end
|
316
341
|
END
|
317
342
|
end
|
318
343
|
|
319
|
-
it
|
344
|
+
it 'adds metadata ":type => :controller' do
|
320
345
|
rewritten_source.should == expected_source
|
321
346
|
end
|
347
|
+
end
|
322
348
|
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
349
|
+
context 'and the file path is "spec/unit/some_spec.rb"' do
|
350
|
+
let(:source_path) { 'spec/unit/some_spec.rb' }
|
351
|
+
|
352
|
+
it 'does nothing' do
|
353
|
+
rewritten_source.should == source
|
327
354
|
end
|
328
355
|
end
|
329
|
-
end
|
330
356
|
|
331
|
-
|
332
|
-
|
357
|
+
context 'and the file path is "features/controllers/some_spec.rb"' do
|
358
|
+
let(:source_path) { 'features/controllers/some_spec.rb' }
|
333
359
|
|
334
|
-
|
360
|
+
it 'does nothing' do
|
361
|
+
rewritten_source.should == source
|
362
|
+
end
|
363
|
+
end
|
364
|
+
end
|
365
|
+
|
366
|
+
context "and expression `describe 'something', :foo => :bar do ... end`" do
|
367
|
+
let(:source) do
|
335
368
|
<<-END
|
336
|
-
describe 'something', :
|
369
|
+
describe 'something', :foo => :bar do
|
337
370
|
end
|
338
371
|
END
|
339
372
|
end
|
340
373
|
|
341
|
-
|
342
|
-
|
343
|
-
end
|
344
|
-
end
|
374
|
+
context 'and the file path is "spec/controllers/some_spec.rb"' do
|
375
|
+
let(:source_path) { 'spec/controllers/some_spec.rb' }
|
345
376
|
|
346
|
-
|
347
|
-
|
377
|
+
let(:expected_source) do
|
378
|
+
<<-END
|
379
|
+
describe 'something', :type => :controller, :foo => :bar do
|
380
|
+
end
|
381
|
+
END
|
382
|
+
end
|
348
383
|
|
349
|
-
|
350
|
-
|
384
|
+
it 'adds metadata ":type => :controller" to the beginning of the hash metadata' do
|
385
|
+
rewritten_source.should == expected_source
|
386
|
+
end
|
351
387
|
end
|
352
388
|
end
|
353
389
|
|
354
|
-
context
|
355
|
-
let(:
|
356
|
-
|
357
|
-
|
358
|
-
|
390
|
+
context "and expression `describe 'something', '#some_method', :foo, :bar => true do ... end`" do
|
391
|
+
let(:source) do
|
392
|
+
<<-END
|
393
|
+
describe 'something', '#some_method', :foo, :bar => true do
|
394
|
+
end
|
395
|
+
END
|
359
396
|
end
|
360
|
-
end
|
361
|
-
end
|
362
397
|
|
363
|
-
|
364
|
-
|
365
|
-
<<-END
|
366
|
-
describe 'something', :foo => :bar do
|
367
|
-
end
|
368
|
-
END
|
369
|
-
end
|
398
|
+
context 'and the file path is "spec/controllers/some_spec.rb"' do
|
399
|
+
let(:source_path) { 'spec/controllers/some_spec.rb' }
|
370
400
|
|
371
|
-
|
372
|
-
|
401
|
+
let(:expected_source) do
|
402
|
+
<<-END
|
403
|
+
describe 'something', '#some_method', :foo, :type => :controller, :bar => true do
|
404
|
+
end
|
405
|
+
END
|
406
|
+
end
|
373
407
|
|
374
|
-
|
408
|
+
it 'adds metadata ":type => :controller" to the beginning of the hash metadata' do
|
409
|
+
rewritten_source.should == expected_source
|
410
|
+
end
|
411
|
+
end
|
412
|
+
end
|
413
|
+
|
414
|
+
context "and expression `describe 'something', foo: :bar do ... end`" do
|
415
|
+
let(:source) do
|
375
416
|
<<-END
|
376
|
-
|
377
|
-
|
417
|
+
describe 'something', foo: :bar do
|
418
|
+
end
|
378
419
|
END
|
379
420
|
end
|
380
421
|
|
381
|
-
|
382
|
-
|
383
|
-
end
|
384
|
-
end
|
385
|
-
end
|
422
|
+
context 'and the file path is "spec/controllers/some_spec.rb"' do
|
423
|
+
let(:source_path) { 'spec/controllers/some_spec.rb' }
|
386
424
|
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
end
|
425
|
+
let(:expected_source) do
|
426
|
+
<<-END
|
427
|
+
describe 'something', type: :controller, foo: :bar do
|
428
|
+
end
|
429
|
+
END
|
430
|
+
end
|
394
431
|
|
395
|
-
|
396
|
-
|
432
|
+
it 'adds metadata "type: :controller"' do
|
433
|
+
rewritten_source.should == expected_source
|
434
|
+
end
|
435
|
+
end
|
436
|
+
end
|
397
437
|
|
398
|
-
|
438
|
+
context "and expression `describe 'something', :type => :foo do ... end`" do
|
439
|
+
let(:source) do
|
399
440
|
<<-END
|
400
|
-
|
401
|
-
|
441
|
+
describe 'something', :type => :foo do
|
442
|
+
end
|
402
443
|
END
|
403
444
|
end
|
404
445
|
|
405
|
-
|
406
|
-
|
446
|
+
context 'and the file path is "spec/controllers/some_spec.rb"' do
|
447
|
+
let(:source_path) { 'spec/controllers/some_spec.rb' }
|
448
|
+
|
449
|
+
it 'does nothing' do
|
450
|
+
rewritten_source.should == source
|
451
|
+
end
|
407
452
|
end
|
408
453
|
end
|
409
|
-
end
|
410
454
|
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
455
|
+
context "and expression `RSpec.describe 'something' do ... end`" do
|
456
|
+
let(:source) do
|
457
|
+
<<-END
|
458
|
+
RSpec.describe 'something' do
|
459
|
+
end
|
460
|
+
END
|
461
|
+
end
|
418
462
|
|
419
|
-
|
420
|
-
|
463
|
+
context 'and the file path is "spec/controllers/some_spec.rb"' do
|
464
|
+
let(:source_path) { 'spec/controllers/some_spec.rb' }
|
421
465
|
|
422
|
-
|
466
|
+
let(:expected_source) do
|
467
|
+
<<-END
|
468
|
+
RSpec.describe 'something', :type => :controller do
|
469
|
+
end
|
470
|
+
END
|
471
|
+
end
|
472
|
+
|
473
|
+
it 'adds metadata ":type => :controller"' do
|
474
|
+
rewritten_source.should == expected_source
|
475
|
+
end
|
476
|
+
end
|
477
|
+
end
|
478
|
+
|
479
|
+
context "and expression `shared_examples 'something' do ... end`" do
|
480
|
+
let(:source) do
|
423
481
|
<<-END
|
424
|
-
|
425
|
-
|
482
|
+
shared_examples 'something' do
|
483
|
+
end
|
426
484
|
END
|
427
485
|
end
|
428
486
|
|
429
|
-
|
430
|
-
|
487
|
+
context 'and the file path is "spec/controllers/some_spec.rb"' do
|
488
|
+
let(:source_path) { 'spec/controllers/some_spec.rb' }
|
489
|
+
|
490
|
+
it 'does nothing' do
|
491
|
+
rewritten_source.should == source
|
492
|
+
end
|
431
493
|
end
|
432
494
|
end
|
433
495
|
end
|
434
496
|
|
435
|
-
context
|
497
|
+
context 'when #describes are nested' do
|
498
|
+
let(:source_path) { 'spec/controllers/some_spec.rb' }
|
499
|
+
|
436
500
|
let(:source) do
|
437
501
|
<<-END
|
438
|
-
|
502
|
+
describe 'something' do
|
503
|
+
describe '#some_method' do
|
439
504
|
end
|
505
|
+
end
|
440
506
|
END
|
441
507
|
end
|
442
508
|
|
443
|
-
|
444
|
-
let(:source_path) { 'spec/controllers/some_spec.rb' }
|
445
|
-
|
446
|
-
it 'does nothing' do
|
447
|
-
rewritten_source.should == source
|
448
|
-
end
|
449
|
-
end
|
450
|
-
end
|
451
|
-
|
452
|
-
context "and expression `RSpec.describe 'something' do ... end`" do
|
453
|
-
let(:source) do
|
509
|
+
let(:expected_source) do
|
454
510
|
<<-END
|
455
|
-
|
511
|
+
describe 'something', :type => :controller do
|
512
|
+
describe '#some_method' do
|
456
513
|
end
|
514
|
+
end
|
457
515
|
END
|
458
516
|
end
|
459
517
|
|
460
|
-
|
461
|
-
|
518
|
+
it 'adds the metadata only to the outmost #describe' do
|
519
|
+
rewritten_source.should == expected_source
|
520
|
+
end
|
521
|
+
end
|
522
|
+
end
|
462
523
|
|
463
|
-
|
464
|
-
|
465
|
-
RSpec.describe 'something', :type => :controller do
|
466
|
-
end
|
467
|
-
END
|
468
|
-
end
|
524
|
+
context 'with runtime information' do
|
525
|
+
include_context 'dynamic analysis objects'
|
469
526
|
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
527
|
+
let(:source_path) { 'spec/controllers/some_spec.rb' }
|
528
|
+
|
529
|
+
before do
|
530
|
+
example_group.add_explicit_type_metadata!
|
474
531
|
end
|
475
532
|
|
476
|
-
context
|
533
|
+
context 'when rspec-rails is loaded in the spec' do
|
477
534
|
let(:source) do
|
478
535
|
<<-END
|
479
|
-
|
536
|
+
module RSpec
|
537
|
+
module Rails
|
480
538
|
end
|
539
|
+
end
|
540
|
+
|
541
|
+
describe 'something' do
|
542
|
+
end
|
481
543
|
END
|
482
544
|
end
|
483
545
|
|
484
|
-
|
485
|
-
|
546
|
+
let(:expected_source) do
|
547
|
+
<<-END
|
548
|
+
module RSpec
|
549
|
+
module Rails
|
550
|
+
end
|
551
|
+
end
|
486
552
|
|
487
|
-
|
488
|
-
|
489
|
-
|
553
|
+
describe 'something', :type => :controller do
|
554
|
+
end
|
555
|
+
END
|
490
556
|
end
|
491
|
-
end
|
492
|
-
end
|
493
|
-
|
494
|
-
context 'when #describes are nested' do
|
495
|
-
let(:source_path) { 'spec/controllers/some_spec.rb' }
|
496
557
|
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
describe '#some_method' do
|
501
|
-
end
|
502
|
-
end
|
503
|
-
END
|
558
|
+
it 'adds the metadata' do
|
559
|
+
rewritten_source.should == expected_source
|
560
|
+
end
|
504
561
|
end
|
505
562
|
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
describe '
|
563
|
+
context 'when rspec-rails is not loaded in the spec' do
|
564
|
+
let(:source) do
|
565
|
+
<<-END
|
566
|
+
describe 'something' do
|
510
567
|
end
|
511
|
-
|
512
|
-
|
513
|
-
end
|
568
|
+
END
|
569
|
+
end
|
514
570
|
|
515
|
-
|
516
|
-
|
571
|
+
it 'does nothing' do
|
572
|
+
rewritten_source.should == source
|
573
|
+
end
|
517
574
|
end
|
518
575
|
end
|
519
576
|
|
520
|
-
context '
|
521
|
-
include_context '
|
577
|
+
context 'without runtime information' do
|
578
|
+
include_context 'isolated environment'
|
522
579
|
|
523
580
|
let(:source_path) { 'spec/controllers/some_spec.rb' }
|
524
581
|
|
525
|
-
|
526
|
-
|
527
|
-
<<-END
|
582
|
+
let(:source) do
|
583
|
+
<<-END
|
528
584
|
module RSpec
|
529
585
|
module Rails
|
530
586
|
end
|
@@ -532,6 +588,70 @@ module Transpec
|
|
532
588
|
|
533
589
|
describe 'something' do
|
534
590
|
end
|
591
|
+
END
|
592
|
+
end
|
593
|
+
|
594
|
+
context 'when rspec-rails is specified in the Gemfile.lock' do
|
595
|
+
before do
|
596
|
+
create_file('Gemfile.lock', <<-END.strip_heredoc)
|
597
|
+
GEM
|
598
|
+
remote: https://rubygems.org/
|
599
|
+
specs:
|
600
|
+
actionpack (4.1.8)
|
601
|
+
actionview (= 4.1.8)
|
602
|
+
activesupport (= 4.1.8)
|
603
|
+
rack (~> 1.5.2)
|
604
|
+
rack-test (~> 0.6.2)
|
605
|
+
actionview (4.1.8)
|
606
|
+
activesupport (= 4.1.8)
|
607
|
+
builder (~> 3.1)
|
608
|
+
erubis (~> 2.7.0)
|
609
|
+
activemodel (4.1.8)
|
610
|
+
activesupport (= 4.1.8)
|
611
|
+
builder (~> 3.1)
|
612
|
+
activesupport (4.1.8)
|
613
|
+
i18n (~> 0.6, >= 0.6.9)
|
614
|
+
json (~> 1.7, >= 1.7.7)
|
615
|
+
minitest (~> 5.1)
|
616
|
+
thread_safe (~> 0.1)
|
617
|
+
tzinfo (~> 1.1)
|
618
|
+
builder (3.2.2)
|
619
|
+
diff-lcs (1.2.5)
|
620
|
+
erubis (2.7.0)
|
621
|
+
i18n (0.6.11)
|
622
|
+
json (1.8.1)
|
623
|
+
minitest (5.4.3)
|
624
|
+
rack (1.5.2)
|
625
|
+
rack-test (0.6.2)
|
626
|
+
rack (>= 1.0)
|
627
|
+
railties (4.1.8)
|
628
|
+
actionpack (= 4.1.8)
|
629
|
+
activesupport (= 4.1.8)
|
630
|
+
rake (>= 0.8.7)
|
631
|
+
thor (>= 0.18.1, < 2.0)
|
632
|
+
rake (10.4.2)
|
633
|
+
rspec-core (2.14.8)
|
634
|
+
rspec-expectations (2.14.5)
|
635
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
636
|
+
rspec-mocks (2.14.6)
|
637
|
+
rspec-rails (2.14.2)
|
638
|
+
actionpack (>= 3.0)
|
639
|
+
activemodel (>= 3.0)
|
640
|
+
activesupport (>= 3.0)
|
641
|
+
railties (>= 3.0)
|
642
|
+
rspec-core (~> 2.14.0)
|
643
|
+
rspec-expectations (~> 2.14.0)
|
644
|
+
rspec-mocks (~> 2.14.0)
|
645
|
+
thor (0.19.1)
|
646
|
+
thread_safe (0.3.4)
|
647
|
+
tzinfo (1.2.2)
|
648
|
+
thread_safe (~> 0.1)
|
649
|
+
|
650
|
+
PLATFORMS
|
651
|
+
ruby
|
652
|
+
|
653
|
+
DEPENDENCIES
|
654
|
+
rspec-rails (~> 2.14.0)
|
535
655
|
END
|
536
656
|
end
|
537
657
|
|
@@ -548,19 +668,44 @@ module Transpec
|
|
548
668
|
end
|
549
669
|
|
550
670
|
it 'adds the metadata' do
|
671
|
+
example_group.add_explicit_type_metadata!
|
551
672
|
rewritten_source.should == expected_source
|
552
673
|
end
|
553
674
|
end
|
554
675
|
|
555
|
-
context 'when rspec-rails is not
|
556
|
-
|
557
|
-
<<-END
|
558
|
-
|
559
|
-
|
676
|
+
context 'when rspec-rails is not specified in the Gemfile.lock' do
|
677
|
+
before do
|
678
|
+
create_file('Gemfile.lock', <<-END.strip_heredoc)
|
679
|
+
GEM
|
680
|
+
remote: https://rubygems.org/
|
681
|
+
specs:
|
682
|
+
diff-lcs (1.2.5)
|
683
|
+
rspec (2.14.1)
|
684
|
+
rspec-core (~> 2.14.0)
|
685
|
+
rspec-expectations (~> 2.14.0)
|
686
|
+
rspec-mocks (~> 2.14.0)
|
687
|
+
rspec-core (2.14.8)
|
688
|
+
rspec-expectations (2.14.5)
|
689
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
690
|
+
rspec-mocks (2.14.6)
|
691
|
+
|
692
|
+
PLATFORMS
|
693
|
+
ruby
|
694
|
+
|
695
|
+
DEPENDENCIES
|
696
|
+
rspec (~> 2.14.0)
|
560
697
|
END
|
561
698
|
end
|
562
699
|
|
563
700
|
it 'does nothing' do
|
701
|
+
example_group.add_explicit_type_metadata!
|
702
|
+
rewritten_source.should == source
|
703
|
+
end
|
704
|
+
end
|
705
|
+
|
706
|
+
context 'when there is no Gemfile.lock' do
|
707
|
+
it 'does nothing' do
|
708
|
+
example_group.add_explicit_type_metadata!
|
564
709
|
rewritten_source.should == source
|
565
710
|
end
|
566
711
|
end
|