@@ -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
@@ -88,7 +86,6 @@ def mock_column(name, type, options={})
88
86
# b_id :integer not null
89
87
# name :string(50) not null
90
88
#
91
-
92
89
EOS
93
90
end
94
91
@@ -107,7 +104,6 @@ def mock_column(name, type, options={})
107
104
#--
108
105
# #{AnnotateModels::END_MARK}
109
106
#++
110
-
111
107
EOS
112
108
end
113
109
@@ -177,7 +173,7 @@ class FooWithMacro < ActiveRecord::Base
177
173
EOS
178
174
check_class_name 'foo_with_macro.rb', 'FooWithMacro'
179
175
end
180
-
176
+
181
177
it "should not care about known macros" do
182
178
create('foo_with_known_macro.rb', <<-EOS)
183
179
class FooWithKnownMacro < ActiveRecord::Base
@@ -347,12 +343,12 @@ def annotate_one_file options = {}
347
343
348
344
it "should annotate the file before the model if position == 'before'" do
349
345
annotate_one_file :position => "before"
350
- File.read(@model_file_name).should == "#{@schema_info}#{@file_content}"
346
+ File.read(@model_file_name).should == "#{@schema_info}\n #{@file_content}"
351
347
end
352
348
353
349
it "should annotate before if given :position => :before" do
354
350
annotate_one_file :position => :before
355
- File.read(@model_file_name).should == "#{@schema_info}#{@file_content}"
351
+ File.read(@model_file_name).should == "#{@schema_info}\n #{@file_content}"
356
352
end
357
353
358
354
it "should annotate after if given :position => :after" do
@@ -384,7 +380,7 @@ class Foo::User < ActiveRecord::Base
384
380
])
385
381
schema_info = AnnotateModels.get_schema_info(klass, "== Schema Info")
386
382
AnnotateModels.annotate_one_file(model_file_name, schema_info, :position => :before)
387
- File.read(model_file_name).should == "#{schema_info}#{file_content}"
383
+ File.read(model_file_name).should == "#{schema_info}\n #{file_content}"
388
384
end
389
385
390
386
describe "if a file can't be annotated" do
0 commit comments