@@ -1018,6 +1018,39 @@ def mock_column(name, type, options = {})
1018
1018
end
1019
1019
end
1020
1020
end
1021
+
1022
+ context 'when "classified_sort" is specified in options' do
1023
+ let :columns do
1024
+ [
1025
+ mock_column ( :active , :boolean , limit : 1 ) ,
1026
+ mock_column ( :name , :string , limit : 50 ) ,
1027
+ mock_column ( :notes , :text , limit : 55 )
1028
+ ]
1029
+ end
1030
+
1031
+ context 'when "classified_sort" is "yes"' do
1032
+ let :options do
1033
+ { classified_sort : 'yes' }
1034
+ end
1035
+
1036
+ let :expected_result do
1037
+ <<~EOS
1038
+ # Schema Info
1039
+ #
1040
+ # Table name: users
1041
+ #
1042
+ # active :boolean not null
1043
+ # name :string(50) not null
1044
+ # notes :text(55) not null
1045
+ #
1046
+ EOS
1047
+ end
1048
+
1049
+ it 'works with option "classified_sort"' do
1050
+ is_expected . to eq expected_result
1051
+ end
1052
+ end
1053
+ end
1021
1054
end
1022
1055
end
1023
1056
end
@@ -1471,39 +1504,6 @@ def mock_column(name, type, options = {})
1471
1504
end
1472
1505
1473
1506
context 'with options' do
1474
- context 'when "classified_sort" is specified in options' do
1475
- let :columns do
1476
- [
1477
- mock_column ( :active , :boolean , limit : 1 ) ,
1478
- mock_column ( :name , :string , limit : 50 ) ,
1479
- mock_column ( :notes , :text , limit : 55 )
1480
- ]
1481
- end
1482
-
1483
- context 'when "classified_sort" is "yes"' do
1484
- let :options do
1485
- { classified_sort : 'yes' }
1486
- end
1487
-
1488
- let :expected_result do
1489
- <<~EOS
1490
- # Schema Info
1491
- #
1492
- # Table name: users
1493
- #
1494
- # active :boolean not null
1495
- # name :string(50) not null
1496
- # notes :text(55) not null
1497
- #
1498
- EOS
1499
- end
1500
-
1501
- it 'works with option "classified_sort"' do
1502
- is_expected . to eq expected_result
1503
- end
1504
- end
1505
- end
1506
-
1507
1507
context 'when "with_comment" is specified in options' do
1508
1508
context 'when "with_comment" is "yes"' do
1509
1509
let :options do
0 commit comments