@@ -2495,7 +2495,7 @@ def annotate_one_file(options = {})
2495
2495
it "should put annotation before class if :position == #{ position } " do
2496
2496
annotate_one_file position : position
2497
2497
expect ( File . read ( @model_file_name ) )
2498
- . to eq ( "#{ @schema_info } \n #{ @file_content } " )
2498
+ . to eq ( "#{ @schema_info } #{ @file_content } " )
2499
2499
end
2500
2500
end
2501
2501
@@ -2510,7 +2510,7 @@ def annotate_one_file(options = {})
2510
2510
it 'should wrap annotation if wrapper is specified' do
2511
2511
annotate_one_file wrapper_open : 'START' , wrapper_close : 'END'
2512
2512
expect ( File . read ( @model_file_name ) )
2513
- . to eq ( "# START\n #{ @schema_info } # END\n \n #{ @file_content } " )
2513
+ . to eq ( "# START\n #{ @schema_info } # END\n #{ @file_content } " )
2514
2514
end
2515
2515
2516
2516
describe 'with existing annotation' do
@@ -2551,7 +2551,7 @@ def annotate_one_file(options = {})
2551
2551
] )
2552
2552
@schema_info = AnnotateModels . get_schema_info ( klass , '== Schema Info' , show_foreign_keys : true )
2553
2553
annotate_one_file
2554
- expect ( File . read ( @model_file_name ) ) . to eq ( "#{ @schema_info } \n #{ @file_content } " )
2554
+ expect ( File . read ( @model_file_name ) ) . to eq ( "#{ @schema_info } #{ @file_content } " )
2555
2555
end
2556
2556
end
2557
2557
end
@@ -2565,12 +2565,12 @@ def annotate_one_file(options = {})
2565
2565
2566
2566
it 'should retain current position' do
2567
2567
annotate_one_file
2568
- expect ( File . read ( @model_file_name ) ) . to eq ( "#{ @schema_info } \n #{ @file_content } " )
2568
+ expect ( File . read ( @model_file_name ) ) . to eq ( "#{ @schema_info } #{ @file_content } " )
2569
2569
end
2570
2570
2571
2571
it 'should retain current position even when :position is changed to :after' do
2572
2572
annotate_one_file position : :after
2573
- expect ( File . read ( @model_file_name ) ) . to eq ( "#{ @schema_info } \n #{ @file_content } " )
2573
+ expect ( File . read ( @model_file_name ) ) . to eq ( "#{ @schema_info } #{ @file_content } " )
2574
2574
end
2575
2575
2576
2576
it 'should change position to :after when force: true' do
@@ -2598,7 +2598,7 @@ def annotate_one_file(options = {})
2598
2598
2599
2599
it 'should change position to :before when force: true' do
2600
2600
annotate_one_file position : :before , force : true
2601
- expect ( File . read ( @model_file_name ) ) . to eq ( "#{ @schema_info } \n #{ @file_content } " )
2601
+ expect ( File . read ( @model_file_name ) ) . to eq ( "#{ @schema_info } #{ @file_content } " )
2602
2602
end
2603
2603
end
2604
2604
@@ -2622,7 +2622,7 @@ class Foo::User < ActiveRecord::Base
2622
2622
] )
2623
2623
schema_info = AnnotateModels . get_schema_info ( klass , '== Schema Info' )
2624
2624
AnnotateModels . annotate_one_file ( model_file_name , schema_info , position : :before )
2625
- expect ( File . read ( model_file_name ) ) . to eq ( "#{ schema_info } \n #{ file_content } " )
2625
+ expect ( File . read ( model_file_name ) ) . to eq ( "#{ schema_info } #{ file_content } " )
2626
2626
end
2627
2627
2628
2628
it 'should not touch magic comments' do
@@ -2652,7 +2652,7 @@ class User < ActiveRecord::Base
2652
2652
annotate_one_file position : :before
2653
2653
schema_info = AnnotateModels . get_schema_info ( @klass , '== Schema Info' )
2654
2654
2655
- expect ( File . read ( model_file_name ) ) . to eq ( "#{ magic_comment } \n \n #{ schema_info } \n #{ content } " )
2655
+ expect ( File . read ( model_file_name ) ) . to eq ( "#{ magic_comment } \n \n #{ schema_info } #{ content } " )
2656
2656
end
2657
2657
end
2658
2658
@@ -2664,7 +2664,7 @@ class User < ActiveRecord::Base
2664
2664
2665
2665
annotate_one_file position : :before
2666
2666
2667
- expect ( File . read ( model_file_name ) ) . to eq ( "#{ magic_comment } \n \n #{ schema_info } \n #{ content } " )
2667
+ expect ( File . read ( model_file_name ) ) . to eq ( "#{ magic_comment } \n \n #{ schema_info } #{ content } " )
2668
2668
end
2669
2669
end
2670
2670
0 commit comments