slaw 4.2.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/slaw/grammars/schedules.treetop +24 -1
- data/lib/slaw/grammars/schedules_nodes.rb +68 -41
- data/lib/slaw/grammars/za/act_text.xsl +7 -3
- data/lib/slaw/version.rb +1 -1
- data/spec/generator_spec.rb +12 -4
- data/spec/za/act_block_spec.rb +0 -576
- data/spec/za/act_inline_spec.rb +21 -0
- data/spec/za/act_schedules_spec.rb +625 -155
- metadata +2 -2
data/spec/za/act_block_spec.rb
CHANGED
@@ -1673,582 +1673,6 @@ EOS
|
|
1673
1673
|
end
|
1674
1674
|
end
|
1675
1675
|
|
1676
|
-
#-------------------------------------------------------------------------------
|
1677
|
-
# schedules
|
1678
|
-
|
1679
|
-
context 'schedules' do
|
1680
|
-
it 'should handle a simple schedule' do
|
1681
|
-
node = parse :schedules, <<EOS
|
1682
|
-
Schedule
|
1683
|
-
|
1684
|
-
Subject to approval in terms of this By-Law, the erection:
|
1685
|
-
1. Foo
|
1686
|
-
2. Bar
|
1687
|
-
EOS
|
1688
|
-
s = to_xml(node)
|
1689
|
-
today = Time.now.strftime('%Y-%m-%d')
|
1690
|
-
s.should == '<component id="component-schedule">
|
1691
|
-
<doc name="schedule">
|
1692
|
-
<meta>
|
1693
|
-
<identification source="#slaw">
|
1694
|
-
<FRBRWork>
|
1695
|
-
<FRBRthis value="/za/act/1980/01/schedule"/>
|
1696
|
-
<FRBRuri value="/za/act/1980/01"/>
|
1697
|
-
<FRBRalias value="Schedule"/>
|
1698
|
-
<FRBRdate date="1980-01-01" name="Generation"/>
|
1699
|
-
<FRBRauthor href="#council"/>
|
1700
|
-
<FRBRcountry value="za"/>
|
1701
|
-
</FRBRWork>
|
1702
|
-
<FRBRExpression>
|
1703
|
-
<FRBRthis value="/za/act/1980/01/eng@/schedule"/>
|
1704
|
-
<FRBRuri value="/za/act/1980/01/eng@"/>
|
1705
|
-
<FRBRdate date="1980-01-01" name="Generation"/>
|
1706
|
-
<FRBRauthor href="#council"/>
|
1707
|
-
<FRBRlanguage language="eng"/>
|
1708
|
-
</FRBRExpression>
|
1709
|
-
<FRBRManifestation>
|
1710
|
-
<FRBRthis value="/za/act/1980/01/eng@/schedule"/>
|
1711
|
-
<FRBRuri value="/za/act/1980/01/eng@"/>
|
1712
|
-
<FRBRdate date="' + today + '" name="Generation"/>
|
1713
|
-
<FRBRauthor href="#slaw"/>
|
1714
|
-
</FRBRManifestation>
|
1715
|
-
</identification>
|
1716
|
-
</meta>
|
1717
|
-
<mainBody>
|
1718
|
-
<hcontainer id="schedule" name="schedule">
|
1719
|
-
<heading>Schedule</heading>
|
1720
|
-
<paragraph id="schedule.paragraph0">
|
1721
|
-
<content>
|
1722
|
-
<p>Subject to approval in terms of this By-Law, the erection:</p>
|
1723
|
-
</content>
|
1724
|
-
</paragraph>
|
1725
|
-
<section id="section-1">
|
1726
|
-
<num>1.</num>
|
1727
|
-
<heading>Foo</heading>
|
1728
|
-
</section>
|
1729
|
-
<section id="section-2">
|
1730
|
-
<num>2.</num>
|
1731
|
-
<heading>Bar</heading>
|
1732
|
-
</section>
|
1733
|
-
</hcontainer>
|
1734
|
-
</mainBody>
|
1735
|
-
</doc>
|
1736
|
-
</component>'
|
1737
|
-
end
|
1738
|
-
|
1739
|
-
it 'should serialise many schedules correctly' do
|
1740
|
-
node = parse :schedules_container, <<EOS
|
1741
|
-
Schedule "2"
|
1742
|
-
A Title
|
1743
|
-
1. Foo
|
1744
|
-
2. Bar
|
1745
|
-
Schedule 3
|
1746
|
-
Another Title
|
1747
|
-
Baz
|
1748
|
-
Boom
|
1749
|
-
EOS
|
1750
|
-
|
1751
|
-
s = to_xml(node)
|
1752
|
-
today = Time.now.strftime('%Y-%m-%d')
|
1753
|
-
s.should == <<EOS
|
1754
|
-
<components>
|
1755
|
-
<component id="component-schedule2">
|
1756
|
-
<doc name="schedule2">
|
1757
|
-
<meta>
|
1758
|
-
<identification source="#slaw">
|
1759
|
-
<FRBRWork>
|
1760
|
-
<FRBRthis value="/za/act/1980/01/schedule2"/>
|
1761
|
-
<FRBRuri value="/za/act/1980/01"/>
|
1762
|
-
<FRBRalias value="Schedule 2"/>
|
1763
|
-
<FRBRdate date="1980-01-01" name="Generation"/>
|
1764
|
-
<FRBRauthor href="#council"/>
|
1765
|
-
<FRBRcountry value="za"/>
|
1766
|
-
</FRBRWork>
|
1767
|
-
<FRBRExpression>
|
1768
|
-
<FRBRthis value="/za/act/1980/01/eng@/schedule2"/>
|
1769
|
-
<FRBRuri value="/za/act/1980/01/eng@"/>
|
1770
|
-
<FRBRdate date="1980-01-01" name="Generation"/>
|
1771
|
-
<FRBRauthor href="#council"/>
|
1772
|
-
<FRBRlanguage language="eng"/>
|
1773
|
-
</FRBRExpression>
|
1774
|
-
<FRBRManifestation>
|
1775
|
-
<FRBRthis value="/za/act/1980/01/eng@/schedule2"/>
|
1776
|
-
<FRBRuri value="/za/act/1980/01/eng@"/>
|
1777
|
-
<FRBRdate date="#{today}" name="Generation"/>
|
1778
|
-
<FRBRauthor href="#slaw"/>
|
1779
|
-
</FRBRManifestation>
|
1780
|
-
</identification>
|
1781
|
-
</meta>
|
1782
|
-
<mainBody>
|
1783
|
-
<hcontainer id="schedule2" name="schedule">
|
1784
|
-
<heading>Schedule 2</heading>
|
1785
|
-
<subheading>A Title</subheading>
|
1786
|
-
<section id="section-1">
|
1787
|
-
<num>1.</num>
|
1788
|
-
<heading>Foo</heading>
|
1789
|
-
</section>
|
1790
|
-
<section id="section-2">
|
1791
|
-
<num>2.</num>
|
1792
|
-
<heading>Bar</heading>
|
1793
|
-
</section>
|
1794
|
-
</hcontainer>
|
1795
|
-
</mainBody>
|
1796
|
-
</doc>
|
1797
|
-
</component>
|
1798
|
-
<component id="component-schedule3">
|
1799
|
-
<doc name="schedule3">
|
1800
|
-
<meta>
|
1801
|
-
<identification source="#slaw">
|
1802
|
-
<FRBRWork>
|
1803
|
-
<FRBRthis value="/za/act/1980/01/schedule3"/>
|
1804
|
-
<FRBRuri value="/za/act/1980/01"/>
|
1805
|
-
<FRBRalias value="Schedule 3"/>
|
1806
|
-
<FRBRdate date="1980-01-01" name="Generation"/>
|
1807
|
-
<FRBRauthor href="#council"/>
|
1808
|
-
<FRBRcountry value="za"/>
|
1809
|
-
</FRBRWork>
|
1810
|
-
<FRBRExpression>
|
1811
|
-
<FRBRthis value="/za/act/1980/01/eng@/schedule3"/>
|
1812
|
-
<FRBRuri value="/za/act/1980/01/eng@"/>
|
1813
|
-
<FRBRdate date="1980-01-01" name="Generation"/>
|
1814
|
-
<FRBRauthor href="#council"/>
|
1815
|
-
<FRBRlanguage language="eng"/>
|
1816
|
-
</FRBRExpression>
|
1817
|
-
<FRBRManifestation>
|
1818
|
-
<FRBRthis value="/za/act/1980/01/eng@/schedule3"/>
|
1819
|
-
<FRBRuri value="/za/act/1980/01/eng@"/>
|
1820
|
-
<FRBRdate date="#{today}" name="Generation"/>
|
1821
|
-
<FRBRauthor href="#slaw"/>
|
1822
|
-
</FRBRManifestation>
|
1823
|
-
</identification>
|
1824
|
-
</meta>
|
1825
|
-
<mainBody>
|
1826
|
-
<hcontainer id="schedule3" name="schedule">
|
1827
|
-
<heading>Schedule 3</heading>
|
1828
|
-
<subheading>Another Title</subheading>
|
1829
|
-
<paragraph id="schedule3.paragraph0">
|
1830
|
-
<content>
|
1831
|
-
<p>Baz</p>
|
1832
|
-
<p>Boom</p>
|
1833
|
-
</content>
|
1834
|
-
</paragraph>
|
1835
|
-
</hcontainer>
|
1836
|
-
</mainBody>
|
1837
|
-
</doc>
|
1838
|
-
</component>
|
1839
|
-
</components>
|
1840
|
-
EOS
|
1841
|
-
.strip
|
1842
|
-
|
1843
|
-
end
|
1844
|
-
|
1845
|
-
it 'should handle a schedule with a title and a number' do
|
1846
|
-
node = parse :schedules, <<EOS
|
1847
|
-
Schedule 1 - First Schedule
|
1848
|
-
Schedule Heading
|
1849
|
-
|
1850
|
-
Subject to approval in terms of this By-Law, the erection:
|
1851
|
-
1. Foo
|
1852
|
-
2. Bar
|
1853
|
-
EOS
|
1854
|
-
s = to_xml(node)
|
1855
|
-
today = Time.now.strftime('%Y-%m-%d')
|
1856
|
-
s.should == '<component id="component-schedule1">
|
1857
|
-
<doc name="schedule1">
|
1858
|
-
<meta>
|
1859
|
-
<identification source="#slaw">
|
1860
|
-
<FRBRWork>
|
1861
|
-
<FRBRthis value="/za/act/1980/01/schedule1"/>
|
1862
|
-
<FRBRuri value="/za/act/1980/01"/>
|
1863
|
-
<FRBRalias value="First Schedule"/>
|
1864
|
-
<FRBRdate date="1980-01-01" name="Generation"/>
|
1865
|
-
<FRBRauthor href="#council"/>
|
1866
|
-
<FRBRcountry value="za"/>
|
1867
|
-
</FRBRWork>
|
1868
|
-
<FRBRExpression>
|
1869
|
-
<FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
|
1870
|
-
<FRBRuri value="/za/act/1980/01/eng@"/>
|
1871
|
-
<FRBRdate date="1980-01-01" name="Generation"/>
|
1872
|
-
<FRBRauthor href="#council"/>
|
1873
|
-
<FRBRlanguage language="eng"/>
|
1874
|
-
</FRBRExpression>
|
1875
|
-
<FRBRManifestation>
|
1876
|
-
<FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
|
1877
|
-
<FRBRuri value="/za/act/1980/01/eng@"/>
|
1878
|
-
<FRBRdate date="' + today + '" name="Generation"/>
|
1879
|
-
<FRBRauthor href="#slaw"/>
|
1880
|
-
</FRBRManifestation>
|
1881
|
-
</identification>
|
1882
|
-
</meta>
|
1883
|
-
<mainBody>
|
1884
|
-
<hcontainer id="schedule1" name="schedule">
|
1885
|
-
<heading>First Schedule</heading>
|
1886
|
-
<subheading>Schedule Heading</subheading>
|
1887
|
-
<paragraph id="schedule1.paragraph0">
|
1888
|
-
<content>
|
1889
|
-
<p>Subject to approval in terms of this By-Law, the erection:</p>
|
1890
|
-
</content>
|
1891
|
-
</paragraph>
|
1892
|
-
<section id="section-1">
|
1893
|
-
<num>1.</num>
|
1894
|
-
<heading>Foo</heading>
|
1895
|
-
</section>
|
1896
|
-
<section id="section-2">
|
1897
|
-
<num>2.</num>
|
1898
|
-
<heading>Bar</heading>
|
1899
|
-
</section>
|
1900
|
-
</hcontainer>
|
1901
|
-
</mainBody>
|
1902
|
-
</doc>
|
1903
|
-
</component>'
|
1904
|
-
end
|
1905
|
-
|
1906
|
-
it 'should handle a schedule with dot in the number' do
|
1907
|
-
node = parse :schedules, <<EOS
|
1908
|
-
Schedule 1. First Schedule
|
1909
|
-
Schedule Heading
|
1910
|
-
|
1911
|
-
Subject to approval in terms of this By-Law, the erection:
|
1912
|
-
1. Foo
|
1913
|
-
2. Bar
|
1914
|
-
EOS
|
1915
|
-
s = to_xml(node)
|
1916
|
-
today = Time.now.strftime('%Y-%m-%d')
|
1917
|
-
s.should == '<component id="component-schedule1">
|
1918
|
-
<doc name="schedule1">
|
1919
|
-
<meta>
|
1920
|
-
<identification source="#slaw">
|
1921
|
-
<FRBRWork>
|
1922
|
-
<FRBRthis value="/za/act/1980/01/schedule1"/>
|
1923
|
-
<FRBRuri value="/za/act/1980/01"/>
|
1924
|
-
<FRBRalias value="First Schedule"/>
|
1925
|
-
<FRBRdate date="1980-01-01" name="Generation"/>
|
1926
|
-
<FRBRauthor href="#council"/>
|
1927
|
-
<FRBRcountry value="za"/>
|
1928
|
-
</FRBRWork>
|
1929
|
-
<FRBRExpression>
|
1930
|
-
<FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
|
1931
|
-
<FRBRuri value="/za/act/1980/01/eng@"/>
|
1932
|
-
<FRBRdate date="1980-01-01" name="Generation"/>
|
1933
|
-
<FRBRauthor href="#council"/>
|
1934
|
-
<FRBRlanguage language="eng"/>
|
1935
|
-
</FRBRExpression>
|
1936
|
-
<FRBRManifestation>
|
1937
|
-
<FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
|
1938
|
-
<FRBRuri value="/za/act/1980/01/eng@"/>
|
1939
|
-
<FRBRdate date="' + today + '" name="Generation"/>
|
1940
|
-
<FRBRauthor href="#slaw"/>
|
1941
|
-
</FRBRManifestation>
|
1942
|
-
</identification>
|
1943
|
-
</meta>
|
1944
|
-
<mainBody>
|
1945
|
-
<hcontainer id="schedule1" name="schedule">
|
1946
|
-
<heading>First Schedule</heading>
|
1947
|
-
<subheading>Schedule Heading</subheading>
|
1948
|
-
<paragraph id="schedule1.paragraph0">
|
1949
|
-
<content>
|
1950
|
-
<p>Subject to approval in terms of this By-Law, the erection:</p>
|
1951
|
-
</content>
|
1952
|
-
</paragraph>
|
1953
|
-
<section id="section-1">
|
1954
|
-
<num>1.</num>
|
1955
|
-
<heading>Foo</heading>
|
1956
|
-
</section>
|
1957
|
-
<section id="section-2">
|
1958
|
-
<num>2.</num>
|
1959
|
-
<heading>Bar</heading>
|
1960
|
-
</section>
|
1961
|
-
</hcontainer>
|
1962
|
-
</mainBody>
|
1963
|
-
</doc>
|
1964
|
-
</component>'
|
1965
|
-
end
|
1966
|
-
|
1967
|
-
it 'should handle a schedule with a title' do
|
1968
|
-
node = parse :schedules, <<EOS
|
1969
|
-
Schedule - First Schedule
|
1970
|
-
|
1971
|
-
Subject to approval in terms of this By-Law, the erection:
|
1972
|
-
1. Foo
|
1973
|
-
2. Bar
|
1974
|
-
EOS
|
1975
|
-
s = to_xml(node)
|
1976
|
-
today = Time.now.strftime('%Y-%m-%d')
|
1977
|
-
s.should == '<component id="component-firstschedule">
|
1978
|
-
<doc name="firstschedule">
|
1979
|
-
<meta>
|
1980
|
-
<identification source="#slaw">
|
1981
|
-
<FRBRWork>
|
1982
|
-
<FRBRthis value="/za/act/1980/01/firstschedule"/>
|
1983
|
-
<FRBRuri value="/za/act/1980/01"/>
|
1984
|
-
<FRBRalias value="First Schedule"/>
|
1985
|
-
<FRBRdate date="1980-01-01" name="Generation"/>
|
1986
|
-
<FRBRauthor href="#council"/>
|
1987
|
-
<FRBRcountry value="za"/>
|
1988
|
-
</FRBRWork>
|
1989
|
-
<FRBRExpression>
|
1990
|
-
<FRBRthis value="/za/act/1980/01/eng@/firstschedule"/>
|
1991
|
-
<FRBRuri value="/za/act/1980/01/eng@"/>
|
1992
|
-
<FRBRdate date="1980-01-01" name="Generation"/>
|
1993
|
-
<FRBRauthor href="#council"/>
|
1994
|
-
<FRBRlanguage language="eng"/>
|
1995
|
-
</FRBRExpression>
|
1996
|
-
<FRBRManifestation>
|
1997
|
-
<FRBRthis value="/za/act/1980/01/eng@/firstschedule"/>
|
1998
|
-
<FRBRuri value="/za/act/1980/01/eng@"/>
|
1999
|
-
<FRBRdate date="' + today + '" name="Generation"/>
|
2000
|
-
<FRBRauthor href="#slaw"/>
|
2001
|
-
</FRBRManifestation>
|
2002
|
-
</identification>
|
2003
|
-
</meta>
|
2004
|
-
<mainBody>
|
2005
|
-
<hcontainer id="firstschedule" name="schedule">
|
2006
|
-
<heading>First Schedule</heading>
|
2007
|
-
<paragraph id="firstschedule.paragraph0">
|
2008
|
-
<content>
|
2009
|
-
<p>Subject to approval in terms of this By-Law, the erection:</p>
|
2010
|
-
</content>
|
2011
|
-
</paragraph>
|
2012
|
-
<section id="section-1">
|
2013
|
-
<num>1.</num>
|
2014
|
-
<heading>Foo</heading>
|
2015
|
-
</section>
|
2016
|
-
<section id="section-2">
|
2017
|
-
<num>2.</num>
|
2018
|
-
<heading>Bar</heading>
|
2019
|
-
</section>
|
2020
|
-
</hcontainer>
|
2021
|
-
</mainBody>
|
2022
|
-
</doc>
|
2023
|
-
</component>'
|
2024
|
-
end
|
2025
|
-
|
2026
|
-
it 'should serialise a single schedule without a heading' do
|
2027
|
-
node = parse :schedules, <<EOS
|
2028
|
-
Schedule "1"
|
2029
|
-
|
2030
|
-
Other than as is set out hereinbelow, no signs other than locality bound signs, temporary signs including loose portable sign, estate agents signs, newspaper headline posters and posters (the erection of which must comply with the appropriate schedules pertinent thereto) shall be erected on Municipal owned land.
|
2031
|
-
1. Foo
|
2032
|
-
2. Bar
|
2033
|
-
EOS
|
2034
|
-
|
2035
|
-
s = to_xml(node)
|
2036
|
-
today = Time.now.strftime('%Y-%m-%d')
|
2037
|
-
s.should == <<EOS
|
2038
|
-
<component id="component-schedule1">
|
2039
|
-
<doc name="schedule1">
|
2040
|
-
<meta>
|
2041
|
-
<identification source="#slaw">
|
2042
|
-
<FRBRWork>
|
2043
|
-
<FRBRthis value="/za/act/1980/01/schedule1"/>
|
2044
|
-
<FRBRuri value="/za/act/1980/01"/>
|
2045
|
-
<FRBRalias value="Schedule 1"/>
|
2046
|
-
<FRBRdate date="1980-01-01" name="Generation"/>
|
2047
|
-
<FRBRauthor href="#council"/>
|
2048
|
-
<FRBRcountry value="za"/>
|
2049
|
-
</FRBRWork>
|
2050
|
-
<FRBRExpression>
|
2051
|
-
<FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
|
2052
|
-
<FRBRuri value="/za/act/1980/01/eng@"/>
|
2053
|
-
<FRBRdate date="1980-01-01" name="Generation"/>
|
2054
|
-
<FRBRauthor href="#council"/>
|
2055
|
-
<FRBRlanguage language="eng"/>
|
2056
|
-
</FRBRExpression>
|
2057
|
-
<FRBRManifestation>
|
2058
|
-
<FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
|
2059
|
-
<FRBRuri value="/za/act/1980/01/eng@"/>
|
2060
|
-
<FRBRdate date="#{today}" name="Generation"/>
|
2061
|
-
<FRBRauthor href="#slaw"/>
|
2062
|
-
</FRBRManifestation>
|
2063
|
-
</identification>
|
2064
|
-
</meta>
|
2065
|
-
<mainBody>
|
2066
|
-
<hcontainer id="schedule1" name="schedule">
|
2067
|
-
<heading>Schedule 1</heading>
|
2068
|
-
<paragraph id="schedule1.paragraph0">
|
2069
|
-
<content>
|
2070
|
-
<p>Other than as is set out hereinbelow, no signs other than locality bound signs, temporary signs including loose portable sign, estate agents signs, newspaper headline posters and posters (the erection of which must comply with the appropriate schedules pertinent thereto) shall be erected on Municipal owned land.</p>
|
2071
|
-
</content>
|
2072
|
-
</paragraph>
|
2073
|
-
<section id="section-1">
|
2074
|
-
<num>1.</num>
|
2075
|
-
<heading>Foo</heading>
|
2076
|
-
</section>
|
2077
|
-
<section id="section-2">
|
2078
|
-
<num>2.</num>
|
2079
|
-
<heading>Bar</heading>
|
2080
|
-
</section>
|
2081
|
-
</hcontainer>
|
2082
|
-
</mainBody>
|
2083
|
-
</doc>
|
2084
|
-
</component>
|
2085
|
-
EOS
|
2086
|
-
.strip
|
2087
|
-
end
|
2088
|
-
|
2089
|
-
it 'should support rich parts, chapters and sections in a schedule' do
|
2090
|
-
node = parse :schedules, <<EOS
|
2091
|
-
Schedule 1
|
2092
|
-
Forms
|
2093
|
-
|
2094
|
-
Part I
|
2095
|
-
Form of authentication statement
|
2096
|
-
|
2097
|
-
This printed impression has been carefully compared by me with the bill which was passed by Parliament and found by me to be a true copy of the bill.
|
2098
|
-
|
2099
|
-
Part II
|
2100
|
-
Form of statement of the President’s assent.
|
2101
|
-
|
2102
|
-
I signify my assent to the bill and a whole bunch of other stuff.
|
2103
|
-
EOS
|
2104
|
-
|
2105
|
-
s = to_xml(node)
|
2106
|
-
today = Time.now.strftime('%Y-%m-%d')
|
2107
|
-
s.should == <<EOS
|
2108
|
-
<component id="component-schedule1">
|
2109
|
-
<doc name="schedule1">
|
2110
|
-
<meta>
|
2111
|
-
<identification source="#slaw">
|
2112
|
-
<FRBRWork>
|
2113
|
-
<FRBRthis value="/za/act/1980/01/schedule1"/>
|
2114
|
-
<FRBRuri value="/za/act/1980/01"/>
|
2115
|
-
<FRBRalias value="Schedule 1"/>
|
2116
|
-
<FRBRdate date="1980-01-01" name="Generation"/>
|
2117
|
-
<FRBRauthor href="#council"/>
|
2118
|
-
<FRBRcountry value="za"/>
|
2119
|
-
</FRBRWork>
|
2120
|
-
<FRBRExpression>
|
2121
|
-
<FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
|
2122
|
-
<FRBRuri value="/za/act/1980/01/eng@"/>
|
2123
|
-
<FRBRdate date="1980-01-01" name="Generation"/>
|
2124
|
-
<FRBRauthor href="#council"/>
|
2125
|
-
<FRBRlanguage language="eng"/>
|
2126
|
-
</FRBRExpression>
|
2127
|
-
<FRBRManifestation>
|
2128
|
-
<FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
|
2129
|
-
<FRBRuri value="/za/act/1980/01/eng@"/>
|
2130
|
-
<FRBRdate date="#{today}" name="Generation"/>
|
2131
|
-
<FRBRauthor href="#slaw"/>
|
2132
|
-
</FRBRManifestation>
|
2133
|
-
</identification>
|
2134
|
-
</meta>
|
2135
|
-
<mainBody>
|
2136
|
-
<hcontainer id="schedule1" name="schedule">
|
2137
|
-
<heading>Schedule 1</heading>
|
2138
|
-
<subheading>Forms</subheading>
|
2139
|
-
<part id="part-I">
|
2140
|
-
<num>I</num>
|
2141
|
-
<heading>Form of authentication statement</heading>
|
2142
|
-
<paragraph id="part-I.paragraph0">
|
2143
|
-
<content>
|
2144
|
-
<p>This printed impression has been carefully compared by me with the bill which was passed by Parliament and found by me to be a true copy of the bill.</p>
|
2145
|
-
</content>
|
2146
|
-
</paragraph>
|
2147
|
-
</part>
|
2148
|
-
<part id="part-II">
|
2149
|
-
<num>II</num>
|
2150
|
-
<heading>Form of statement of the President’s assent.</heading>
|
2151
|
-
<paragraph id="part-II.paragraph0">
|
2152
|
-
<content>
|
2153
|
-
<p>I signify my assent to the bill and a whole bunch of other stuff.</p>
|
2154
|
-
</content>
|
2155
|
-
</paragraph>
|
2156
|
-
</part>
|
2157
|
-
</hcontainer>
|
2158
|
-
</mainBody>
|
2159
|
-
</doc>
|
2160
|
-
</component>
|
2161
|
-
EOS
|
2162
|
-
.strip
|
2163
|
-
end
|
2164
|
-
|
2165
|
-
it 'should not get confused by schedule headings in TOC' do
|
2166
|
-
parse :schedules_container, <<EOS
|
2167
|
-
Schedule 1. Summoning and procedure of Joint Sittings of Senate and House of Assembly.
|
2168
|
-
Schedule 2. Oaths.
|
2169
|
-
Schedule 3. Matters which shall continue to be regulated by Swazi Law and Custom.
|
2170
|
-
Schedule 4. Specially entrenched provisions and entrenched provisions.
|
2171
|
-
EOS
|
2172
|
-
end
|
2173
|
-
|
2174
|
-
it 'should handle escaped schedules' do
|
2175
|
-
node = parse :schedules, <<EOS
|
2176
|
-
Schedule
|
2177
|
-
|
2178
|
-
Subject to approval in terms of this By-Law.
|
2179
|
-
|
2180
|
-
\\Schedule another
|
2181
|
-
|
2182
|
-
More stuff
|
2183
|
-
EOS
|
2184
|
-
s = to_xml(node)
|
2185
|
-
today = Time.now.strftime('%Y-%m-%d')
|
2186
|
-
s.should == '<component id="component-schedule">
|
2187
|
-
<doc name="schedule">
|
2188
|
-
<meta>
|
2189
|
-
<identification source="#slaw">
|
2190
|
-
<FRBRWork>
|
2191
|
-
<FRBRthis value="/za/act/1980/01/schedule"/>
|
2192
|
-
<FRBRuri value="/za/act/1980/01"/>
|
2193
|
-
<FRBRalias value="Schedule"/>
|
2194
|
-
<FRBRdate date="1980-01-01" name="Generation"/>
|
2195
|
-
<FRBRauthor href="#council"/>
|
2196
|
-
<FRBRcountry value="za"/>
|
2197
|
-
</FRBRWork>
|
2198
|
-
<FRBRExpression>
|
2199
|
-
<FRBRthis value="/za/act/1980/01/eng@/schedule"/>
|
2200
|
-
<FRBRuri value="/za/act/1980/01/eng@"/>
|
2201
|
-
<FRBRdate date="1980-01-01" name="Generation"/>
|
2202
|
-
<FRBRauthor href="#council"/>
|
2203
|
-
<FRBRlanguage language="eng"/>
|
2204
|
-
</FRBRExpression>
|
2205
|
-
<FRBRManifestation>
|
2206
|
-
<FRBRthis value="/za/act/1980/01/eng@/schedule"/>
|
2207
|
-
<FRBRuri value="/za/act/1980/01/eng@"/>
|
2208
|
-
<FRBRdate date="' + today + '" name="Generation"/>
|
2209
|
-
<FRBRauthor href="#slaw"/>
|
2210
|
-
</FRBRManifestation>
|
2211
|
-
</identification>
|
2212
|
-
</meta>
|
2213
|
-
<mainBody>
|
2214
|
-
<hcontainer id="schedule" name="schedule">
|
2215
|
-
<heading>Schedule</heading>
|
2216
|
-
<paragraph id="schedule.paragraph0">
|
2217
|
-
<content>
|
2218
|
-
<p>Subject to approval in terms of this By-Law.</p>
|
2219
|
-
<p>Schedule another</p>
|
2220
|
-
<p>More stuff</p>
|
2221
|
-
</content>
|
2222
|
-
</paragraph>
|
2223
|
-
</hcontainer>
|
2224
|
-
</mainBody>
|
2225
|
-
</doc>
|
2226
|
-
</component>'
|
2227
|
-
end
|
2228
|
-
|
2229
|
-
end
|
2230
|
-
|
2231
|
-
#-------------------------------------------------------------------------------
|
2232
|
-
# inline_items
|
2233
|
-
|
2234
|
-
context 'inline_items' do
|
2235
|
-
it 'should handle a simple clause' do
|
2236
|
-
node = parse :inline_items, "simple text"
|
2237
|
-
node.text_value.should == "simple text"
|
2238
|
-
end
|
2239
|
-
|
2240
|
-
it 'should handle a clause with a remark' do
|
2241
|
-
node = parse :inline_items, "simple [[remark]]. text"
|
2242
|
-
node.text_value.should == "simple [[remark]]. text"
|
2243
|
-
node.elements[7].is_a?(Slaw::Grammars::ZA::Act::Remark).should be true
|
2244
|
-
|
2245
|
-
node = parse :inline_items, "simple [[remark]][[another]] text"
|
2246
|
-
node.text_value.should == "simple [[remark]][[another]] text"
|
2247
|
-
node.elements[7].is_a?(Slaw::Grammars::ZA::Act::Remark).should be true
|
2248
|
-
node.elements[7].is_a?(Slaw::Grammars::ZA::Act::Remark).should be true
|
2249
|
-
end
|
2250
|
-
end
|
2251
|
-
|
2252
1676
|
#-------------------------------------------------------------------------------
|
2253
1677
|
# crossheadings
|
2254
1678
|
|
data/spec/za/act_inline_spec.rb
CHANGED
@@ -33,6 +33,27 @@ describe Slaw::ActGenerator do
|
|
33
33
|
Slaw::Grammars::ZA::Act::BlockElements.counters.clear
|
34
34
|
end
|
35
35
|
|
36
|
+
#-------------------------------------------------------------------------------
|
37
|
+
# inline_items
|
38
|
+
|
39
|
+
context 'inline_items' do
|
40
|
+
it 'should handle a simple clause' do
|
41
|
+
node = parse :inline_items, "simple text"
|
42
|
+
node.text_value.should == "simple text"
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'should handle a clause with a remark' do
|
46
|
+
node = parse :inline_items, "simple [[remark]]. text"
|
47
|
+
node.text_value.should == "simple [[remark]]. text"
|
48
|
+
node.elements[7].is_a?(Slaw::Grammars::ZA::Act::Remark).should be true
|
49
|
+
|
50
|
+
node = parse :inline_items, "simple [[remark]][[another]] text"
|
51
|
+
node.text_value.should == "simple [[remark]][[another]] text"
|
52
|
+
node.elements[7].is_a?(Slaw::Grammars::ZA::Act::Remark).should be true
|
53
|
+
node.elements[7].is_a?(Slaw::Grammars::ZA::Act::Remark).should be true
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
36
57
|
#-------------------------------------------------------------------------------
|
37
58
|
# Remarks
|
38
59
|
|