@@ -939,6 +939,85 @@ def mock_column(name, type, options = {})
939
939
end
940
940
end
941
941
end
942
+
943
+ context 'when "hide_default_column_types" is specified in options' do
944
+ let :columns do
945
+ [
946
+ mock_column ( :profile , :json , default : { } ) ,
947
+ mock_column ( :settings , :jsonb , default : { } ) ,
948
+ mock_column ( :parameters , :hstore , default : { } )
949
+ ]
950
+ end
951
+
952
+ context 'when "hide_default_column_types" is blank string' do
953
+ let :options do
954
+ { hide_default_column_types : '' }
955
+ end
956
+
957
+ let :expected_result do
958
+ <<~EOS
959
+ # Schema Info
960
+ #
961
+ # Table name: users
962
+ #
963
+ # profile :json not null
964
+ # settings :jsonb not null
965
+ # parameters :hstore not null
966
+ #
967
+ EOS
968
+ end
969
+
970
+ it 'works with option "hide_default_column_types"' do
971
+ is_expected . to eq expected_result
972
+ end
973
+ end
974
+
975
+ context 'when "hide_default_column_types" is "skip"' do
976
+ let :options do
977
+ { hide_default_column_types : 'skip' }
978
+ end
979
+
980
+ let :expected_result do
981
+ <<~EOS
982
+ # Schema Info
983
+ #
984
+ # Table name: users
985
+ #
986
+ # profile :json default({}), not null
987
+ # settings :jsonb default({}), not null
988
+ # parameters :hstore default({}), not null
989
+ #
990
+ EOS
991
+ end
992
+
993
+ it 'works with option "hide_default_column_types"' do
994
+ is_expected . to eq expected_result
995
+ end
996
+ end
997
+
998
+ context 'when "hide_default_column_types" is "json"' do
999
+ let :options do
1000
+ { hide_default_column_types : 'json' }
1001
+ end
1002
+
1003
+ let :expected_result do
1004
+ <<~EOS
1005
+ # Schema Info
1006
+ #
1007
+ # Table name: users
1008
+ #
1009
+ # profile :json not null
1010
+ # settings :jsonb default({}), not null
1011
+ # parameters :hstore default({}), not null
1012
+ #
1013
+ EOS
1014
+ end
1015
+
1016
+ it 'works with option "hide_limit_column_types"' do
1017
+ is_expected . to eq expected_result
1018
+ end
1019
+ end
1020
+ end
942
1021
end
943
1022
end
944
1023
end
@@ -1392,85 +1471,6 @@ def mock_column(name, type, options = {})
1392
1471
end
1393
1472
1394
1473
context 'with options' do
1395
- context 'when "hide_default_column_types" is specified in options' do
1396
- let :columns do
1397
- [
1398
- mock_column ( :profile , :json , default : { } ) ,
1399
- mock_column ( :settings , :jsonb , default : { } ) ,
1400
- mock_column ( :parameters , :hstore , default : { } )
1401
- ]
1402
- end
1403
-
1404
- context 'when "hide_default_column_types" is blank string' do
1405
- let :options do
1406
- { hide_default_column_types : '' }
1407
- end
1408
-
1409
- let :expected_result do
1410
- <<~EOS
1411
- # Schema Info
1412
- #
1413
- # Table name: users
1414
- #
1415
- # profile :json not null
1416
- # settings :jsonb not null
1417
- # parameters :hstore not null
1418
- #
1419
- EOS
1420
- end
1421
-
1422
- it 'works with option "hide_default_column_types"' do
1423
- is_expected . to eq expected_result
1424
- end
1425
- end
1426
-
1427
- context 'when "hide_default_column_types" is "skip"' do
1428
- let :options do
1429
- { hide_default_column_types : 'skip' }
1430
- end
1431
-
1432
- let :expected_result do
1433
- <<~EOS
1434
- # Schema Info
1435
- #
1436
- # Table name: users
1437
- #
1438
- # profile :json default({}), not null
1439
- # settings :jsonb default({}), not null
1440
- # parameters :hstore default({}), not null
1441
- #
1442
- EOS
1443
- end
1444
-
1445
- it 'works with option "hide_default_column_types"' do
1446
- is_expected . to eq expected_result
1447
- end
1448
- end
1449
-
1450
- context 'when "hide_default_column_types" is "json"' do
1451
- let :options do
1452
- { hide_default_column_types : 'json' }
1453
- end
1454
-
1455
- let :expected_result do
1456
- <<~EOS
1457
- # Schema Info
1458
- #
1459
- # Table name: users
1460
- #
1461
- # profile :json not null
1462
- # settings :jsonb default({}), not null
1463
- # parameters :hstore default({}), not null
1464
- #
1465
- EOS
1466
- end
1467
-
1468
- it 'works with option "hide_limit_column_types"' do
1469
- is_expected . to eq expected_result
1470
- end
1471
- end
1472
- end
1473
-
1474
1474
context 'when "classified_sort" is specified in options' do
1475
1475
let :columns do
1476
1476
[
0 commit comments