@@ -177,7 +177,7 @@ def mock_column(name, type, options = {})
177
177
178
178
describe '.get_schema_info' do
179
179
subject do
180
- AnnotateModels . get_schema_info ( klass , header )
180
+ AnnotateModels . get_schema_info ( klass , header , ** options )
181
181
end
182
182
183
183
let :klass do
@@ -193,8 +193,8 @@ def mock_column(name, type, options = {})
193
193
end
194
194
195
195
context 'when option is not present' do
196
- subject do
197
- AnnotateModels . get_schema_info ( klass , header )
196
+ let :options do
197
+ { }
198
198
end
199
199
200
200
context 'when header is "Schema Info"' do
@@ -476,8 +476,8 @@ def mock_column(name, type, options = {})
476
476
477
477
context 'when indexes exist' do
478
478
context 'when option "show_indexes" is true' do
479
- subject do
480
- AnnotateModels . get_schema_info ( klass , header , show_indexes : true )
479
+ let :options do
480
+ { show_indexes : true }
481
481
end
482
482
483
483
context 'when indexes are normal' do
@@ -677,8 +677,8 @@ def mock_column(name, type, options = {})
677
677
end
678
678
679
679
context 'when option "simple_indexes" is true' do
680
- subject do
681
- AnnotateModels . get_schema_info ( klass , header , simple_indexes : true )
680
+ let :options do
681
+ { simple_indexes : true }
682
682
end
683
683
684
684
context 'when one of indexes includes "orders" clause' do
@@ -766,8 +766,8 @@ def mock_column(name, type, options = {})
766
766
end
767
767
768
768
context 'when option "show_foreign_keys" is specified' do
769
- subject do
770
- AnnotateModels . get_schema_info ( klass , header , show_foreign_keys : true )
769
+ let :options do
770
+ { show_foreign_keys : true }
771
771
end
772
772
773
773
context 'when foreign_keys does not have option' do
@@ -829,8 +829,8 @@ def mock_column(name, type, options = {})
829
829
end
830
830
831
831
context 'when option "show_foreign_keys" and "show_complete_foreign_keys" are specified' do
832
- subject do
833
- AnnotateModels . get_schema_info ( klass , header , show_foreign_keys : true , show_complete_foreign_keys : true )
832
+ let :options do
833
+ { show_foreign_keys : true , show_complete_foreign_keys : true }
834
834
end
835
835
836
836
let :expected_result do
@@ -879,8 +879,8 @@ def mock_column(name, type, options = {})
879
879
end
880
880
881
881
context 'when option "format_rdoc" is true' do
882
- subject do
883
- AnnotateModels . get_schema_info ( klass , header , format_rdoc : true )
882
+ let :options do
883
+ { format_rdoc : true }
884
884
end
885
885
886
886
let :expected_result do
@@ -903,8 +903,8 @@ def mock_column(name, type, options = {})
903
903
end
904
904
905
905
context 'when option "format_yard" is true' do
906
- subject do
907
- AnnotateModels . get_schema_info ( klass , header , format_yard : true )
906
+ let :options do
907
+ { format_yard : true }
908
908
end
909
909
910
910
let :expected_result do
@@ -928,8 +928,8 @@ def mock_column(name, type, options = {})
928
928
929
929
context 'when option "format_markdown" is true' do
930
930
context 'when other option is not specified' do
931
- subject do
932
- AnnotateModels . get_schema_info ( klass , header , format_markdown : true )
931
+ let :options do
932
+ { format_markdown : true }
933
933
end
934
934
935
935
let :expected_result do
@@ -954,8 +954,8 @@ def mock_column(name, type, options = {})
954
954
end
955
955
956
956
context 'when option "show_indexes" is true' do
957
- subject do
958
- AnnotateModels . get_schema_info ( klass , header , format_markdown : true , show_indexes : true )
957
+ let :options do
958
+ { format_markdown : true , show_indexes : true }
959
959
end
960
960
961
961
context 'when indexes are normal' do
@@ -1149,8 +1149,8 @@ def mock_column(name, type, options = {})
1149
1149
end
1150
1150
1151
1151
context 'when option "show_foreign_keys" is true' do
1152
- subject do
1153
- AnnotateModels . get_schema_info ( klass , header , format_markdown : true , show_foreign_keys : true )
1152
+ let :options do
1153
+ { format_markdown : true , show_foreign_keys : true }
1154
1154
end
1155
1155
1156
1156
let :columns do
@@ -1623,8 +1623,8 @@ def mock_column(name, type, options = {})
1623
1623
end
1624
1624
1625
1625
context 'when "format_doc" and "with_comment" are specified in options' do
1626
- subject do
1627
- AnnotateModels . get_schema_info ( klass , AnnotateModels :: PREFIX , format_rdoc : true , with_comment : true )
1626
+ let :options do
1627
+ { format_rdoc : true , with_comment : true }
1628
1628
end
1629
1629
1630
1630
context 'when columns are normal' do
@@ -1656,8 +1656,8 @@ def mock_column(name, type, options = {})
1656
1656
end
1657
1657
1658
1658
context 'when "format_markdown" and "with_comment" are specified in options' do
1659
- subject do
1660
- AnnotateModels . get_schema_info ( klass , AnnotateModels :: PREFIX , format_markdown : true , with_comment : true )
1659
+ let :options do
1660
+ { format_markdown : true , with_comment : true }
1661
1661
end
1662
1662
1663
1663
context 'when columns have comments' do
0 commit comments