slaw 4.2.0 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -35,75 +35,22 @@ describe Slaw::ActGenerator do
35
35
 
36
36
  #-------------------------------------------------------------------------------
37
37
  # schedules
38
-
38
+ #
39
39
  context 'schedules' do
40
- it 'should handle a simple schedule' do
41
- node = parse :schedules, <<EOS
42
- Schedule
43
-
44
- Subject to approval in terms of this By-Law, the erection:
45
- 1. Foo
46
- 2. Bar
47
- EOS
48
- s = to_xml(node)
49
- today = Time.now.strftime('%Y-%m-%d')
50
- s.should == '<component id="component-schedule">
51
- <doc name="schedule">
52
- <meta>
53
- <identification source="#slaw">
54
- <FRBRWork>
55
- <FRBRthis value="/za/act/1980/01/schedule"/>
56
- <FRBRuri value="/za/act/1980/01"/>
57
- <FRBRalias value="Schedule"/>
58
- <FRBRdate date="1980-01-01" name="Generation"/>
59
- <FRBRauthor href="#council"/>
60
- <FRBRcountry value="za"/>
61
- </FRBRWork>
62
- <FRBRExpression>
63
- <FRBRthis value="/za/act/1980/01/eng@/schedule"/>
64
- <FRBRuri value="/za/act/1980/01/eng@"/>
65
- <FRBRdate date="1980-01-01" name="Generation"/>
66
- <FRBRauthor href="#council"/>
67
- <FRBRlanguage language="eng"/>
68
- </FRBRExpression>
69
- <FRBRManifestation>
70
- <FRBRthis value="/za/act/1980/01/eng@/schedule"/>
71
- <FRBRuri value="/za/act/1980/01/eng@"/>
72
- <FRBRdate date="' + today + '" name="Generation"/>
73
- <FRBRauthor href="#slaw"/>
74
- </FRBRManifestation>
75
- </identification>
76
- </meta>
77
- <mainBody>
78
- <hcontainer id="schedule" name="schedule">
79
- <heading>Schedule</heading>
80
- <paragraph id="schedule.paragraph0">
81
- <content>
82
- <p>Subject to approval in terms of this By-Law, the erection:</p>
83
- </content>
84
- </paragraph>
85
- <section id="section-1">
86
- <num>1.</num>
87
- <heading>Foo</heading>
88
- </section>
89
- <section id="section-2">
90
- <num>2.</num>
91
- <heading>Bar</heading>
92
- </section>
93
- </hcontainer>
94
- </mainBody>
95
- </doc>
96
- </component>'
97
- end
98
-
99
40
  it 'should serialise many schedules correctly' do
100
41
  node = parse :schedules_container, <<EOS
101
- Schedule "2"
102
- A Title
42
+ SCHEDULE
43
+
44
+ HEADING Schedule 2
45
+
46
+ SUBHEADING A Title
47
+
48
+
103
49
  1. Foo
104
50
  2. Bar
105
- Schedule 3
106
- Another Title
51
+ SCHEDULE
52
+ HEADING Schedule 3
53
+ SUBHEADING Another Title
107
54
  Baz
108
55
  Boom
109
56
  EOS
@@ -202,10 +149,11 @@ EOS
202
149
 
203
150
  end
204
151
 
205
- it 'should handle a schedule with a title and a number' do
152
+ it 'should handle a schedule with a heading and a subheading' do
206
153
  node = parse :schedules, <<EOS
207
- Schedule 1 - First Schedule
208
- Schedule Heading
154
+ SCHEDULE
155
+ HEADING First Schedule
156
+ SUBHEADING Schedule Heading
209
157
 
210
158
  Subject to approval in terms of this By-Law, the erection:
211
159
  1. Foo
@@ -213,12 +161,12 @@ Subject to approval in terms of this By-Law, the erection:
213
161
  EOS
214
162
  s = to_xml(node)
215
163
  today = Time.now.strftime('%Y-%m-%d')
216
- s.should == '<component id="component-schedule1">
217
- <doc name="schedule1">
164
+ s.should == '<component id="component-firstschedule">
165
+ <doc name="firstschedule">
218
166
  <meta>
219
167
  <identification source="#slaw">
220
168
  <FRBRWork>
221
- <FRBRthis value="/za/act/1980/01/schedule1"/>
169
+ <FRBRthis value="/za/act/1980/01/firstschedule"/>
222
170
  <FRBRuri value="/za/act/1980/01"/>
223
171
  <FRBRalias value="First Schedule"/>
224
172
  <FRBRdate date="1980-01-01" name="Generation"/>
@@ -226,14 +174,14 @@ EOS
226
174
  <FRBRcountry value="za"/>
227
175
  </FRBRWork>
228
176
  <FRBRExpression>
229
- <FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
177
+ <FRBRthis value="/za/act/1980/01/eng@/firstschedule"/>
230
178
  <FRBRuri value="/za/act/1980/01/eng@"/>
231
179
  <FRBRdate date="1980-01-01" name="Generation"/>
232
180
  <FRBRauthor href="#council"/>
233
181
  <FRBRlanguage language="eng"/>
234
182
  </FRBRExpression>
235
183
  <FRBRManifestation>
236
- <FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
184
+ <FRBRthis value="/za/act/1980/01/eng@/firstschedule"/>
237
185
  <FRBRuri value="/za/act/1980/01/eng@"/>
238
186
  <FRBRdate date="' + today + '" name="Generation"/>
239
187
  <FRBRauthor href="#slaw"/>
@@ -241,10 +189,10 @@ EOS
241
189
  </identification>
242
190
  </meta>
243
191
  <mainBody>
244
- <hcontainer id="schedule1" name="schedule">
192
+ <hcontainer id="firstschedule" name="schedule">
245
193
  <heading>First Schedule</heading>
246
194
  <subheading>Schedule Heading</subheading>
247
- <paragraph id="schedule1.paragraph0">
195
+ <paragraph id="firstschedule.paragraph0">
248
196
  <content>
249
197
  <p>Subject to approval in terms of this By-Law, the erection:</p>
250
198
  </content>
@@ -265,8 +213,9 @@ EOS
265
213
 
266
214
  it 'should handle a schedule with dot in the number' do
267
215
  node = parse :schedules, <<EOS
268
- Schedule 1. First Schedule
269
- Schedule Heading
216
+ SCHEDULE
217
+ HEADING 1. First Schedule
218
+ SUBHEADING Schedule Heading
270
219
 
271
220
  Subject to approval in terms of this By-Law, the erection:
272
221
  1. Foo
@@ -274,27 +223,27 @@ Subject to approval in terms of this By-Law, the erection:
274
223
  EOS
275
224
  s = to_xml(node)
276
225
  today = Time.now.strftime('%Y-%m-%d')
277
- s.should == '<component id="component-schedule1">
278
- <doc name="schedule1">
226
+ s.should == '<component id="component-1firstschedule">
227
+ <doc name="1firstschedule">
279
228
  <meta>
280
229
  <identification source="#slaw">
281
230
  <FRBRWork>
282
- <FRBRthis value="/za/act/1980/01/schedule1"/>
231
+ <FRBRthis value="/za/act/1980/01/1firstschedule"/>
283
232
  <FRBRuri value="/za/act/1980/01"/>
284
- <FRBRalias value="First Schedule"/>
233
+ <FRBRalias value="1. First Schedule"/>
285
234
  <FRBRdate date="1980-01-01" name="Generation"/>
286
235
  <FRBRauthor href="#council"/>
287
236
  <FRBRcountry value="za"/>
288
237
  </FRBRWork>
289
238
  <FRBRExpression>
290
- <FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
239
+ <FRBRthis value="/za/act/1980/01/eng@/1firstschedule"/>
291
240
  <FRBRuri value="/za/act/1980/01/eng@"/>
292
241
  <FRBRdate date="1980-01-01" name="Generation"/>
293
242
  <FRBRauthor href="#council"/>
294
243
  <FRBRlanguage language="eng"/>
295
244
  </FRBRExpression>
296
245
  <FRBRManifestation>
297
- <FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
246
+ <FRBRthis value="/za/act/1980/01/eng@/1firstschedule"/>
298
247
  <FRBRuri value="/za/act/1980/01/eng@"/>
299
248
  <FRBRdate date="' + today + '" name="Generation"/>
300
249
  <FRBRauthor href="#slaw"/>
@@ -302,10 +251,10 @@ EOS
302
251
  </identification>
303
252
  </meta>
304
253
  <mainBody>
305
- <hcontainer id="schedule1" name="schedule">
306
- <heading>First Schedule</heading>
254
+ <hcontainer id="1firstschedule" name="schedule">
255
+ <heading>1. First Schedule</heading>
307
256
  <subheading>Schedule Heading</subheading>
308
- <paragraph id="schedule1.paragraph0">
257
+ <paragraph id="1firstschedule.paragraph0">
309
258
  <content>
310
259
  <p>Subject to approval in terms of this By-Law, the erection:</p>
311
260
  </content>
@@ -326,7 +275,8 @@ EOS
326
275
 
327
276
  it 'should handle a schedule with a title' do
328
277
  node = parse :schedules, <<EOS
329
- Schedule - First Schedule
278
+ SCHEDULE
279
+ HEADING First Schedule
330
280
 
331
281
  Subject to approval in terms of this By-Law, the erection:
332
282
  1. Foo
@@ -383,73 +333,11 @@ EOS
383
333
  </component>'
384
334
  end
385
335
 
386
- it 'should serialise a single schedule without a heading' do
387
- node = parse :schedules, <<EOS
388
- Schedule "1"
389
-
390
- 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.
391
- 1. Foo
392
- 2. Bar
393
- EOS
394
-
395
- s = to_xml(node)
396
- today = Time.now.strftime('%Y-%m-%d')
397
- s.should == <<EOS
398
- <component id="component-schedule1">
399
- <doc name="schedule1">
400
- <meta>
401
- <identification source="#slaw">
402
- <FRBRWork>
403
- <FRBRthis value="/za/act/1980/01/schedule1"/>
404
- <FRBRuri value="/za/act/1980/01"/>
405
- <FRBRalias value="Schedule 1"/>
406
- <FRBRdate date="1980-01-01" name="Generation"/>
407
- <FRBRauthor href="#council"/>
408
- <FRBRcountry value="za"/>
409
- </FRBRWork>
410
- <FRBRExpression>
411
- <FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
412
- <FRBRuri value="/za/act/1980/01/eng@"/>
413
- <FRBRdate date="1980-01-01" name="Generation"/>
414
- <FRBRauthor href="#council"/>
415
- <FRBRlanguage language="eng"/>
416
- </FRBRExpression>
417
- <FRBRManifestation>
418
- <FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
419
- <FRBRuri value="/za/act/1980/01/eng@"/>
420
- <FRBRdate date="#{today}" name="Generation"/>
421
- <FRBRauthor href="#slaw"/>
422
- </FRBRManifestation>
423
- </identification>
424
- </meta>
425
- <mainBody>
426
- <hcontainer id="schedule1" name="schedule">
427
- <heading>Schedule 1</heading>
428
- <paragraph id="schedule1.paragraph0">
429
- <content>
430
- <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>
431
- </content>
432
- </paragraph>
433
- <section id="section-1">
434
- <num>1.</num>
435
- <heading>Foo</heading>
436
- </section>
437
- <section id="section-2">
438
- <num>2.</num>
439
- <heading>Bar</heading>
440
- </section>
441
- </hcontainer>
442
- </mainBody>
443
- </doc>
444
- </component>
445
- EOS
446
- .strip
447
- end
448
-
449
336
  it 'should support rich parts, chapters and sections in a schedule' do
450
337
  node = parse :schedules, <<EOS
451
- Schedule 1
452
- Forms
338
+ SCHEDULE
339
+ HEADING Schedule 1
340
+ SUBHEADING Forms
453
341
 
454
342
  Part I
455
343
  Form of authentication statement
@@ -588,8 +476,9 @@ EOS
588
476
 
589
477
  it 'should handle rich content in titles and subheandings' do
590
478
  node = parse :schedules, <<EOS
591
- Schedule - First Schedule [[remark]]
592
- Subheading [[another]]
479
+ SCHEDULE
480
+ HEADING First Schedule [[remark]]
481
+ SUBHEADING Subheading [[another]]
593
482
 
594
483
  Subject to approval in terms of this By-Law.
595
484
  EOS
@@ -637,6 +526,587 @@ EOS
637
526
  </component>'
638
527
  end
639
528
 
640
- end
641
- end
529
+ it 'should handle a schedule without a heading' do
530
+ node = parse :schedules, <<EOS
531
+ SCHEDULE
532
+ SUBHEADING Subheading
533
+
534
+ Subject to approval in terms of this By-Law, the erection:
535
+ 1. Foo
536
+ 2. Bar
537
+ EOS
538
+ s = to_xml(node)
539
+ today = Time.now.strftime('%Y-%m-%d')
540
+ s.should == '<component id="component-schedule">
541
+ <doc name="schedule">
542
+ <meta>
543
+ <identification source="#slaw">
544
+ <FRBRWork>
545
+ <FRBRthis value="/za/act/1980/01/schedule"/>
546
+ <FRBRuri value="/za/act/1980/01"/>
547
+ <FRBRalias value="Schedule"/>
548
+ <FRBRdate date="1980-01-01" name="Generation"/>
549
+ <FRBRauthor href="#council"/>
550
+ <FRBRcountry value="za"/>
551
+ </FRBRWork>
552
+ <FRBRExpression>
553
+ <FRBRthis value="/za/act/1980/01/eng@/schedule"/>
554
+ <FRBRuri value="/za/act/1980/01/eng@"/>
555
+ <FRBRdate date="1980-01-01" name="Generation"/>
556
+ <FRBRauthor href="#council"/>
557
+ <FRBRlanguage language="eng"/>
558
+ </FRBRExpression>
559
+ <FRBRManifestation>
560
+ <FRBRthis value="/za/act/1980/01/eng@/schedule"/>
561
+ <FRBRuri value="/za/act/1980/01/eng@"/>
562
+ <FRBRdate date="' + today + '" name="Generation"/>
563
+ <FRBRauthor href="#slaw"/>
564
+ </FRBRManifestation>
565
+ </identification>
566
+ </meta>
567
+ <mainBody>
568
+ <hcontainer id="schedule" name="schedule">
569
+ <heading>Schedule</heading>
570
+ <subheading>Subheading</subheading>
571
+ <paragraph id="schedule.paragraph0">
572
+ <content>
573
+ <p>Subject to approval in terms of this By-Law, the erection:</p>
574
+ </content>
575
+ </paragraph>
576
+ <section id="section-1">
577
+ <num>1.</num>
578
+ <heading>Foo</heading>
579
+ </section>
580
+ <section id="section-2">
581
+ <num>2.</num>
582
+ <heading>Bar</heading>
583
+ </section>
584
+ </hcontainer>
585
+ </mainBody>
586
+ </doc>
587
+ </component>'
588
+ end
589
+
590
+ it 'should handle a schedule with an empty heading and subheading' do
591
+ node = parse :schedules, <<EOS
592
+ SCHEDULE
593
+ HEADING
594
+ SUBHEADING
642
595
 
596
+ Subject to approval in terms of this By-Law, the erection:
597
+ 1. Foo
598
+ EOS
599
+ s = to_xml(node)
600
+ today = Time.now.strftime('%Y-%m-%d')
601
+ s.should == '<component id="component-schedule">
602
+ <doc name="schedule">
603
+ <meta>
604
+ <identification source="#slaw">
605
+ <FRBRWork>
606
+ <FRBRthis value="/za/act/1980/01/schedule"/>
607
+ <FRBRuri value="/za/act/1980/01"/>
608
+ <FRBRalias value="Schedule"/>
609
+ <FRBRdate date="1980-01-01" name="Generation"/>
610
+ <FRBRauthor href="#council"/>
611
+ <FRBRcountry value="za"/>
612
+ </FRBRWork>
613
+ <FRBRExpression>
614
+ <FRBRthis value="/za/act/1980/01/eng@/schedule"/>
615
+ <FRBRuri value="/za/act/1980/01/eng@"/>
616
+ <FRBRdate date="1980-01-01" name="Generation"/>
617
+ <FRBRauthor href="#council"/>
618
+ <FRBRlanguage language="eng"/>
619
+ </FRBRExpression>
620
+ <FRBRManifestation>
621
+ <FRBRthis value="/za/act/1980/01/eng@/schedule"/>
622
+ <FRBRuri value="/za/act/1980/01/eng@"/>
623
+ <FRBRdate date="' + today + '" name="Generation"/>
624
+ <FRBRauthor href="#slaw"/>
625
+ </FRBRManifestation>
626
+ </identification>
627
+ </meta>
628
+ <mainBody>
629
+ <hcontainer id="schedule" name="schedule">
630
+ <heading>Schedule</heading>
631
+ <paragraph id="schedule.paragraph0">
632
+ <content>
633
+ <p>Subject to approval in terms of this By-Law, the erection:</p>
634
+ </content>
635
+ </paragraph>
636
+ <section id="section-1">
637
+ <num>1.</num>
638
+ <heading>Foo</heading>
639
+ </section>
640
+ </hcontainer>
641
+ </mainBody>
642
+ </doc>
643
+ </component>'
644
+ end
645
+
646
+ end
647
+
648
+ context 'legacy schedules' do
649
+ context 'schedules' do
650
+ it 'should handle a simple schedule' do
651
+ node = parse :schedules, <<EOS
652
+ Schedule
653
+
654
+ Subject to approval in terms of this By-Law, the erection:
655
+ 1. Foo
656
+ 2. Bar
657
+ EOS
658
+ s = to_xml(node)
659
+ today = Time.now.strftime('%Y-%m-%d')
660
+ s.should == '<component id="component-schedule">
661
+ <doc name="schedule">
662
+ <meta>
663
+ <identification source="#slaw">
664
+ <FRBRWork>
665
+ <FRBRthis value="/za/act/1980/01/schedule"/>
666
+ <FRBRuri value="/za/act/1980/01"/>
667
+ <FRBRalias value="Schedule"/>
668
+ <FRBRdate date="1980-01-01" name="Generation"/>
669
+ <FRBRauthor href="#council"/>
670
+ <FRBRcountry value="za"/>
671
+ </FRBRWork>
672
+ <FRBRExpression>
673
+ <FRBRthis value="/za/act/1980/01/eng@/schedule"/>
674
+ <FRBRuri value="/za/act/1980/01/eng@"/>
675
+ <FRBRdate date="1980-01-01" name="Generation"/>
676
+ <FRBRauthor href="#council"/>
677
+ <FRBRlanguage language="eng"/>
678
+ </FRBRExpression>
679
+ <FRBRManifestation>
680
+ <FRBRthis value="/za/act/1980/01/eng@/schedule"/>
681
+ <FRBRuri value="/za/act/1980/01/eng@"/>
682
+ <FRBRdate date="' + today + '" name="Generation"/>
683
+ <FRBRauthor href="#slaw"/>
684
+ </FRBRManifestation>
685
+ </identification>
686
+ </meta>
687
+ <mainBody>
688
+ <hcontainer id="schedule" name="schedule">
689
+ <heading>Schedule</heading>
690
+ <paragraph id="schedule.paragraph0">
691
+ <content>
692
+ <p>Subject to approval in terms of this By-Law, the erection:</p>
693
+ </content>
694
+ </paragraph>
695
+ <section id="section-1">
696
+ <num>1.</num>
697
+ <heading>Foo</heading>
698
+ </section>
699
+ <section id="section-2">
700
+ <num>2.</num>
701
+ <heading>Bar</heading>
702
+ </section>
703
+ </hcontainer>
704
+ </mainBody>
705
+ </doc>
706
+ </component>'
707
+ end
708
+
709
+ it 'should serialise many schedules correctly' do
710
+ node = parse :schedules_container, <<EOS
711
+ Schedule 2
712
+ A Title
713
+ 1. Foo
714
+ 2. Bar
715
+ Schedule 3
716
+ Another Title
717
+ Baz
718
+ Boom
719
+ EOS
720
+
721
+ s = to_xml(node)
722
+ today = Time.now.strftime('%Y-%m-%d')
723
+ s.should == <<EOS
724
+ <components>
725
+ <component id="component-schedule2">
726
+ <doc name="schedule2">
727
+ <meta>
728
+ <identification source="#slaw">
729
+ <FRBRWork>
730
+ <FRBRthis value="/za/act/1980/01/schedule2"/>
731
+ <FRBRuri value="/za/act/1980/01"/>
732
+ <FRBRalias value="Schedule 2"/>
733
+ <FRBRdate date="1980-01-01" name="Generation"/>
734
+ <FRBRauthor href="#council"/>
735
+ <FRBRcountry value="za"/>
736
+ </FRBRWork>
737
+ <FRBRExpression>
738
+ <FRBRthis value="/za/act/1980/01/eng@/schedule2"/>
739
+ <FRBRuri value="/za/act/1980/01/eng@"/>
740
+ <FRBRdate date="1980-01-01" name="Generation"/>
741
+ <FRBRauthor href="#council"/>
742
+ <FRBRlanguage language="eng"/>
743
+ </FRBRExpression>
744
+ <FRBRManifestation>
745
+ <FRBRthis value="/za/act/1980/01/eng@/schedule2"/>
746
+ <FRBRuri value="/za/act/1980/01/eng@"/>
747
+ <FRBRdate date="#{today}" name="Generation"/>
748
+ <FRBRauthor href="#slaw"/>
749
+ </FRBRManifestation>
750
+ </identification>
751
+ </meta>
752
+ <mainBody>
753
+ <hcontainer id="schedule2" name="schedule">
754
+ <heading>Schedule 2</heading>
755
+ <subheading>A Title</subheading>
756
+ <section id="section-1">
757
+ <num>1.</num>
758
+ <heading>Foo</heading>
759
+ </section>
760
+ <section id="section-2">
761
+ <num>2.</num>
762
+ <heading>Bar</heading>
763
+ </section>
764
+ </hcontainer>
765
+ </mainBody>
766
+ </doc>
767
+ </component>
768
+ <component id="component-schedule3">
769
+ <doc name="schedule3">
770
+ <meta>
771
+ <identification source="#slaw">
772
+ <FRBRWork>
773
+ <FRBRthis value="/za/act/1980/01/schedule3"/>
774
+ <FRBRuri value="/za/act/1980/01"/>
775
+ <FRBRalias value="Schedule 3"/>
776
+ <FRBRdate date="1980-01-01" name="Generation"/>
777
+ <FRBRauthor href="#council"/>
778
+ <FRBRcountry value="za"/>
779
+ </FRBRWork>
780
+ <FRBRExpression>
781
+ <FRBRthis value="/za/act/1980/01/eng@/schedule3"/>
782
+ <FRBRuri value="/za/act/1980/01/eng@"/>
783
+ <FRBRdate date="1980-01-01" name="Generation"/>
784
+ <FRBRauthor href="#council"/>
785
+ <FRBRlanguage language="eng"/>
786
+ </FRBRExpression>
787
+ <FRBRManifestation>
788
+ <FRBRthis value="/za/act/1980/01/eng@/schedule3"/>
789
+ <FRBRuri value="/za/act/1980/01/eng@"/>
790
+ <FRBRdate date="#{today}" name="Generation"/>
791
+ <FRBRauthor href="#slaw"/>
792
+ </FRBRManifestation>
793
+ </identification>
794
+ </meta>
795
+ <mainBody>
796
+ <hcontainer id="schedule3" name="schedule">
797
+ <heading>Schedule 3</heading>
798
+ <subheading>Another Title</subheading>
799
+ <paragraph id="schedule3.paragraph0">
800
+ <content>
801
+ <p>Baz</p>
802
+ <p>Boom</p>
803
+ </content>
804
+ </paragraph>
805
+ </hcontainer>
806
+ </mainBody>
807
+ </doc>
808
+ </component>
809
+ </components>
810
+ EOS
811
+ .strip
812
+
813
+ end
814
+
815
+ it 'should handle a schedule with a title and a number' do
816
+ node = parse :schedules, <<EOS
817
+ Schedule 1 - First Schedule
818
+ Schedule Heading
819
+
820
+ Subject to approval in terms of this By-Law, the erection:
821
+ 1. Foo
822
+ 2. Bar
823
+ EOS
824
+ s = to_xml(node)
825
+ today = Time.now.strftime('%Y-%m-%d')
826
+ s.should == '<component id="component-1firstschedule">
827
+ <doc name="1firstschedule">
828
+ <meta>
829
+ <identification source="#slaw">
830
+ <FRBRWork>
831
+ <FRBRthis value="/za/act/1980/01/1firstschedule"/>
832
+ <FRBRuri value="/za/act/1980/01"/>
833
+ <FRBRalias value="1 - First Schedule"/>
834
+ <FRBRdate date="1980-01-01" name="Generation"/>
835
+ <FRBRauthor href="#council"/>
836
+ <FRBRcountry value="za"/>
837
+ </FRBRWork>
838
+ <FRBRExpression>
839
+ <FRBRthis value="/za/act/1980/01/eng@/1firstschedule"/>
840
+ <FRBRuri value="/za/act/1980/01/eng@"/>
841
+ <FRBRdate date="1980-01-01" name="Generation"/>
842
+ <FRBRauthor href="#council"/>
843
+ <FRBRlanguage language="eng"/>
844
+ </FRBRExpression>
845
+ <FRBRManifestation>
846
+ <FRBRthis value="/za/act/1980/01/eng@/1firstschedule"/>
847
+ <FRBRuri value="/za/act/1980/01/eng@"/>
848
+ <FRBRdate date="' + today + '" name="Generation"/>
849
+ <FRBRauthor href="#slaw"/>
850
+ </FRBRManifestation>
851
+ </identification>
852
+ </meta>
853
+ <mainBody>
854
+ <hcontainer id="1firstschedule" name="schedule">
855
+ <heading>1 - First Schedule</heading>
856
+ <subheading>Schedule Heading</subheading>
857
+ <paragraph id="1firstschedule.paragraph0">
858
+ <content>
859
+ <p>Subject to approval in terms of this By-Law, the erection:</p>
860
+ </content>
861
+ </paragraph>
862
+ <section id="section-1">
863
+ <num>1.</num>
864
+ <heading>Foo</heading>
865
+ </section>
866
+ <section id="section-2">
867
+ <num>2.</num>
868
+ <heading>Bar</heading>
869
+ </section>
870
+ </hcontainer>
871
+ </mainBody>
872
+ </doc>
873
+ </component>'
874
+ end
875
+
876
+ it 'should handle a schedule with dot in the number' do
877
+ node = parse :schedules, <<EOS
878
+ Schedule 1. First Schedule
879
+ Schedule Heading
880
+
881
+ Subject to approval in terms of this By-Law, the erection:
882
+ 1. Foo
883
+ 2. Bar
884
+ EOS
885
+ s = to_xml(node)
886
+ today = Time.now.strftime('%Y-%m-%d')
887
+ s.should == '<component id="component-1firstschedule">
888
+ <doc name="1firstschedule">
889
+ <meta>
890
+ <identification source="#slaw">
891
+ <FRBRWork>
892
+ <FRBRthis value="/za/act/1980/01/1firstschedule"/>
893
+ <FRBRuri value="/za/act/1980/01"/>
894
+ <FRBRalias value="1. First Schedule"/>
895
+ <FRBRdate date="1980-01-01" name="Generation"/>
896
+ <FRBRauthor href="#council"/>
897
+ <FRBRcountry value="za"/>
898
+ </FRBRWork>
899
+ <FRBRExpression>
900
+ <FRBRthis value="/za/act/1980/01/eng@/1firstschedule"/>
901
+ <FRBRuri value="/za/act/1980/01/eng@"/>
902
+ <FRBRdate date="1980-01-01" name="Generation"/>
903
+ <FRBRauthor href="#council"/>
904
+ <FRBRlanguage language="eng"/>
905
+ </FRBRExpression>
906
+ <FRBRManifestation>
907
+ <FRBRthis value="/za/act/1980/01/eng@/1firstschedule"/>
908
+ <FRBRuri value="/za/act/1980/01/eng@"/>
909
+ <FRBRdate date="' + today + '" name="Generation"/>
910
+ <FRBRauthor href="#slaw"/>
911
+ </FRBRManifestation>
912
+ </identification>
913
+ </meta>
914
+ <mainBody>
915
+ <hcontainer id="1firstschedule" name="schedule">
916
+ <heading>1. First Schedule</heading>
917
+ <subheading>Schedule Heading</subheading>
918
+ <paragraph id="1firstschedule.paragraph0">
919
+ <content>
920
+ <p>Subject to approval in terms of this By-Law, the erection:</p>
921
+ </content>
922
+ </paragraph>
923
+ <section id="section-1">
924
+ <num>1.</num>
925
+ <heading>Foo</heading>
926
+ </section>
927
+ <section id="section-2">
928
+ <num>2.</num>
929
+ <heading>Bar</heading>
930
+ </section>
931
+ </hcontainer>
932
+ </mainBody>
933
+ </doc>
934
+ </component>'
935
+ end
936
+
937
+ it 'should handle a schedule with a title' do
938
+ node = parse :schedules, <<EOS
939
+ Schedule - First Schedule
940
+
941
+ Subject to approval in terms of this By-Law, the erection:
942
+ 1. Foo
943
+ 2. Bar
944
+ EOS
945
+ s = to_xml(node)
946
+ today = Time.now.strftime('%Y-%m-%d')
947
+ s.should == '<component id="component-firstschedule">
948
+ <doc name="firstschedule">
949
+ <meta>
950
+ <identification source="#slaw">
951
+ <FRBRWork>
952
+ <FRBRthis value="/za/act/1980/01/firstschedule"/>
953
+ <FRBRuri value="/za/act/1980/01"/>
954
+ <FRBRalias value="First Schedule"/>
955
+ <FRBRdate date="1980-01-01" name="Generation"/>
956
+ <FRBRauthor href="#council"/>
957
+ <FRBRcountry value="za"/>
958
+ </FRBRWork>
959
+ <FRBRExpression>
960
+ <FRBRthis value="/za/act/1980/01/eng@/firstschedule"/>
961
+ <FRBRuri value="/za/act/1980/01/eng@"/>
962
+ <FRBRdate date="1980-01-01" name="Generation"/>
963
+ <FRBRauthor href="#council"/>
964
+ <FRBRlanguage language="eng"/>
965
+ </FRBRExpression>
966
+ <FRBRManifestation>
967
+ <FRBRthis value="/za/act/1980/01/eng@/firstschedule"/>
968
+ <FRBRuri value="/za/act/1980/01/eng@"/>
969
+ <FRBRdate date="' + today + '" name="Generation"/>
970
+ <FRBRauthor href="#slaw"/>
971
+ </FRBRManifestation>
972
+ </identification>
973
+ </meta>
974
+ <mainBody>
975
+ <hcontainer id="firstschedule" name="schedule">
976
+ <heading>First Schedule</heading>
977
+ <paragraph id="firstschedule.paragraph0">
978
+ <content>
979
+ <p>Subject to approval in terms of this By-Law, the erection:</p>
980
+ </content>
981
+ </paragraph>
982
+ <section id="section-1">
983
+ <num>1.</num>
984
+ <heading>Foo</heading>
985
+ </section>
986
+ <section id="section-2">
987
+ <num>2.</num>
988
+ <heading>Bar</heading>
989
+ </section>
990
+ </hcontainer>
991
+ </mainBody>
992
+ </doc>
993
+ </component>'
994
+ end
995
+
996
+ it 'should serialise a single schedule without a heading' do
997
+ node = parse :schedules, <<EOS
998
+ Schedule 1
999
+
1000
+ 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.
1001
+ 1. Foo
1002
+ 2. Bar
1003
+ EOS
1004
+
1005
+ s = to_xml(node)
1006
+ today = Time.now.strftime('%Y-%m-%d')
1007
+ s.should == <<EOS
1008
+ <component id="component-schedule1">
1009
+ <doc name="schedule1">
1010
+ <meta>
1011
+ <identification source="#slaw">
1012
+ <FRBRWork>
1013
+ <FRBRthis value="/za/act/1980/01/schedule1"/>
1014
+ <FRBRuri value="/za/act/1980/01"/>
1015
+ <FRBRalias value="Schedule 1"/>
1016
+ <FRBRdate date="1980-01-01" name="Generation"/>
1017
+ <FRBRauthor href="#council"/>
1018
+ <FRBRcountry value="za"/>
1019
+ </FRBRWork>
1020
+ <FRBRExpression>
1021
+ <FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
1022
+ <FRBRuri value="/za/act/1980/01/eng@"/>
1023
+ <FRBRdate date="1980-01-01" name="Generation"/>
1024
+ <FRBRauthor href="#council"/>
1025
+ <FRBRlanguage language="eng"/>
1026
+ </FRBRExpression>
1027
+ <FRBRManifestation>
1028
+ <FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
1029
+ <FRBRuri value="/za/act/1980/01/eng@"/>
1030
+ <FRBRdate date="#{today}" name="Generation"/>
1031
+ <FRBRauthor href="#slaw"/>
1032
+ </FRBRManifestation>
1033
+ </identification>
1034
+ </meta>
1035
+ <mainBody>
1036
+ <hcontainer id="schedule1" name="schedule">
1037
+ <heading>Schedule 1</heading>
1038
+ <paragraph id="schedule1.paragraph0">
1039
+ <content>
1040
+ <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>
1041
+ </content>
1042
+ </paragraph>
1043
+ <section id="section-1">
1044
+ <num>1.</num>
1045
+ <heading>Foo</heading>
1046
+ </section>
1047
+ <section id="section-2">
1048
+ <num>2.</num>
1049
+ <heading>Bar</heading>
1050
+ </section>
1051
+ </hcontainer>
1052
+ </mainBody>
1053
+ </doc>
1054
+ </component>
1055
+ EOS
1056
+ .strip
1057
+ end
1058
+
1059
+ it 'should handle rich content in titles and subheandings' do
1060
+ node = parse :schedules, <<EOS
1061
+ Schedule - First Schedule [[remark]]
1062
+ Subheading [[another]]
1063
+
1064
+ Subject to approval in terms of this By-Law.
1065
+ EOS
1066
+ s = to_xml(node)
1067
+ today = Time.now.strftime('%Y-%m-%d')
1068
+ s.should == '<component id="component-firstschedule">
1069
+ <doc name="firstschedule">
1070
+ <meta>
1071
+ <identification source="#slaw">
1072
+ <FRBRWork>
1073
+ <FRBRthis value="/za/act/1980/01/firstschedule"/>
1074
+ <FRBRuri value="/za/act/1980/01"/>
1075
+ <FRBRalias value="First Schedule"/>
1076
+ <FRBRdate date="1980-01-01" name="Generation"/>
1077
+ <FRBRauthor href="#council"/>
1078
+ <FRBRcountry value="za"/>
1079
+ </FRBRWork>
1080
+ <FRBRExpression>
1081
+ <FRBRthis value="/za/act/1980/01/eng@/firstschedule"/>
1082
+ <FRBRuri value="/za/act/1980/01/eng@"/>
1083
+ <FRBRdate date="1980-01-01" name="Generation"/>
1084
+ <FRBRauthor href="#council"/>
1085
+ <FRBRlanguage language="eng"/>
1086
+ </FRBRExpression>
1087
+ <FRBRManifestation>
1088
+ <FRBRthis value="/za/act/1980/01/eng@/firstschedule"/>
1089
+ <FRBRuri value="/za/act/1980/01/eng@"/>
1090
+ <FRBRdate date="' + today + '" name="Generation"/>
1091
+ <FRBRauthor href="#slaw"/>
1092
+ </FRBRManifestation>
1093
+ </identification>
1094
+ </meta>
1095
+ <mainBody>
1096
+ <hcontainer id="firstschedule" name="schedule">
1097
+ <heading>First Schedule <remark status="editorial">[remark]</remark></heading>
1098
+ <subheading>Subheading <remark status="editorial">[another]</remark></subheading>
1099
+ <paragraph id="firstschedule.paragraph0">
1100
+ <content>
1101
+ <p>Subject to approval in terms of this By-Law.</p>
1102
+ </content>
1103
+ </paragraph>
1104
+ </hcontainer>
1105
+ </mainBody>
1106
+ </doc>
1107
+ </component>'
1108
+ end
1109
+
1110
+ end
1111
+ end
1112
+ end