@@ -51,7 +51,6 @@ def mock_column(name, type, options={})
51
51
# id :integer not null, primary key
52
52
# name :string(50) not null
53
53
#
54
-
55
54
EOS
56
55
end
57
56
@@ -69,7 +68,6 @@ def mock_column(name, type, options={})
69
68
# id :integer not null
70
69
# name :string(50) not null
71
70
#
72
-
73
71
EOS
74
72
end
75
73
@@ -89,7 +87,6 @@ def mock_column(name, type, options={})
89
87
# b_id :integer not null
90
88
# name :string(50) not null
91
89
#
92
-
93
90
EOS
94
91
end
95
92
it "should get schema info with enum type " do
@@ -125,7 +122,6 @@ def mock_column(name, type, options={})
125
122
#--
126
123
# #{ AnnotateModels ::END_MARK }
127
124
#++
128
-
129
125
EOS
130
126
end
131
127
@@ -195,7 +191,7 @@ class FooWithMacro < ActiveRecord::Base
195
191
EOS
196
192
check_class_name 'foo_with_macro.rb' , 'FooWithMacro'
197
193
end
198
-
194
+
199
195
it "should not care about known macros" do
200
196
create ( 'foo_with_known_macro.rb' , <<-EOS )
201
197
class FooWithKnownMacro < ActiveRecord::Base
@@ -365,12 +361,12 @@ def annotate_one_file options = {}
365
361
366
362
it "should annotate the file before the model if position == 'before'" do
367
363
annotate_one_file :position => "before"
368
- File . read ( @model_file_name ) . should == "#{ @schema_info } #{ @file_content } "
364
+ File . read ( @model_file_name ) . should == "#{ @schema_info } \n #{ @file_content } "
369
365
end
370
366
371
367
it "should annotate before if given :position => :before" do
372
368
annotate_one_file :position => :before
373
- File . read ( @model_file_name ) . should == "#{ @schema_info } #{ @file_content } "
369
+ File . read ( @model_file_name ) . should == "#{ @schema_info } \n #{ @file_content } "
374
370
end
375
371
376
372
it "should annotate after if given :position => :after" do
@@ -402,7 +398,7 @@ class Foo::User < ActiveRecord::Base
402
398
] )
403
399
schema_info = AnnotateModels . get_schema_info ( klass , "== Schema Info" )
404
400
AnnotateModels . annotate_one_file ( model_file_name , schema_info , :position => :before )
405
- File . read ( model_file_name ) . should == "#{ schema_info } #{ file_content } "
401
+ File . read ( model_file_name ) . should == "#{ schema_info } \n #{ file_content } "
406
402
end
407
403
408
404
describe "if a file can't be annotated" do
0 commit comments