@@ -1505,6 +1505,39 @@ def mock_column(name, type, options = {})
1505
1505
end
1506
1506
end
1507
1507
end
1508
+
1509
+ context 'when "format_doc" and "with_comment" are specified in options' do
1510
+ let :options do
1511
+ { format_rdoc : true , with_comment : true }
1512
+ end
1513
+
1514
+ context 'when columns are normal' do
1515
+ let :columns do
1516
+ [
1517
+ mock_column ( :id , :integer , comment : 'ID' ) ,
1518
+ mock_column ( :name , :string , limit : 50 , comment : 'Name' )
1519
+ ]
1520
+ end
1521
+
1522
+ let :expected_result do
1523
+ <<~EOS
1524
+ # == Schema Information
1525
+ #
1526
+ # Table name: users
1527
+ #
1528
+ # *id(ID)*:: <tt>integer, not null, primary key</tt>
1529
+ # *name(Name)*:: <tt>string(50), not null</tt>
1530
+ #--
1531
+ # == Schema Information End
1532
+ #++
1533
+ EOS
1534
+ end
1535
+
1536
+ it 'returns schema info in RDoc format' do
1537
+ is_expected . to eq expected_result
1538
+ end
1539
+ end
1540
+ end
1508
1541
end
1509
1542
end
1510
1543
end
@@ -1614,39 +1647,6 @@ def mock_column(name, type, options = {})
1614
1647
AnnotateModels ::PREFIX
1615
1648
end
1616
1649
1617
- context 'when "format_doc" and "with_comment" are specified in options' do
1618
- let :options do
1619
- { format_rdoc : true , with_comment : true }
1620
- end
1621
-
1622
- context 'when columns are normal' do
1623
- let :columns do
1624
- [
1625
- mock_column ( :id , :integer , comment : 'ID' ) ,
1626
- mock_column ( :name , :string , limit : 50 , comment : 'Name' )
1627
- ]
1628
- end
1629
-
1630
- let :expected_result do
1631
- <<~EOS
1632
- # == Schema Information
1633
- #
1634
- # Table name: users
1635
- #
1636
- # *id(ID)*:: <tt>integer, not null, primary key</tt>
1637
- # *name(Name)*:: <tt>string(50), not null</tt>
1638
- #--
1639
- # == Schema Information End
1640
- #++
1641
- EOS
1642
- end
1643
-
1644
- it 'returns schema info in RDoc format' do
1645
- is_expected . to eq expected_result
1646
- end
1647
- end
1648
- end
1649
-
1650
1650
context 'when "format_markdown" and "with_comment" are specified in options' do
1651
1651
let :options do
1652
1652
{ format_markdown : true , with_comment : true }
0 commit comments