|
13 | 13 |
|
14 | 14 | it 'returns false for unmarked documents' do |
15 | 15 | plain = Prawn::Document.new |
16 | | - expect(plain).not_to be_tagged |
| 16 | + expect(plain).to_not(be_tagged) |
17 | 17 | end |
18 | 18 | end |
19 | 19 |
|
|
27 | 27 | describe '#structure' do |
28 | 28 | it 'wraps content in a structure element' do |
29 | 29 | pdf.structure(:H1) do |
30 | | - pdf.text 'Title' |
| 30 | + pdf.text('Title') |
31 | 31 | end |
32 | 32 | output = pdf.render |
33 | 33 |
|
|
37 | 37 |
|
38 | 38 | it 'emits BDC/EMC in the content stream' do |
39 | 39 | pdf.structure(:P) do |
40 | | - pdf.text 'Hello' |
| 40 | + pdf.text('Hello') |
41 | 41 | end |
42 | 42 | output = pdf.render |
43 | 43 |
|
|
48 | 48 | it 'is a no-op for untagged documents' do |
49 | 49 | plain = Prawn::Document.new |
50 | 50 | plain.structure(:P) do |
51 | | - plain.text 'Hello' |
| 51 | + plain.text('Hello') |
52 | 52 | end |
53 | 53 | output = plain.render |
54 | 54 |
|
55 | | - expect(output).not_to include('/StructTreeRoot') |
| 55 | + expect(output).to_not(include('/StructTreeRoot')) |
56 | 56 | end |
57 | 57 | end |
58 | 58 |
|
59 | 59 | describe '#structure_container' do |
60 | 60 | it 'creates a parent structure without marking content directly' do |
61 | 61 | pdf.structure_container(:Table) do |
62 | 62 | pdf.structure(:TD) do |
63 | | - pdf.text 'Cell' |
| 63 | + pdf.text('Cell') |
64 | 64 | end |
65 | 65 | end |
66 | 66 | output = pdf.render |
|
74 | 74 | describe '#artifact' do |
75 | 75 | it 'wraps content in Artifact markers' do |
76 | 76 | pdf.artifact do |
77 | | - pdf.text 'Page 1' |
| 77 | + pdf.text('Page 1') |
78 | 78 | end |
79 | 79 | output = pdf.render |
80 | 80 |
|
|
84 | 84 |
|
85 | 85 | it 'supports artifact type' do |
86 | 86 | pdf.artifact(type: :Pagination) do |
87 | | - pdf.text 'Page 1' |
| 87 | + pdf.text('Page 1') |
88 | 88 | end |
89 | 89 | output = pdf.render |
90 | 90 |
|
|
95 | 95 | it 'is a no-op for untagged documents' do |
96 | 96 | plain = Prawn::Document.new |
97 | 97 | plain.artifact do |
98 | | - plain.text 'Footer' |
| 98 | + plain.text('Footer') |
99 | 99 | end |
100 | 100 | output = plain.render |
101 | 101 |
|
102 | | - expect(output).not_to include('/Artifact') |
| 102 | + expect(output).to_not(include('/Artifact')) |
103 | 103 | end |
104 | 104 | end |
105 | 105 |
|
|
134 | 134 |
|
135 | 135 | it 'supports block form' do |
136 | 136 | pdf.paragraph do |
137 | | - pdf.text 'Complex paragraph' |
| 137 | + pdf.text('Complex paragraph') |
138 | 138 | end |
139 | 139 | output = pdf.render |
140 | 140 |
|
|
146 | 146 | describe 'ActualText' do |
147 | 147 | it 'passes ActualText to structure elements' do |
148 | 148 | pdf.structure(:Span, ActualText: 'required') do |
149 | | - pdf.text '*' |
| 149 | + pdf.text('*') |
150 | 150 | end |
151 | 151 | output = pdf.render |
152 | 152 |
|
|
155 | 155 |
|
156 | 156 | it 'allows ActualText for checkbox indicators' do |
157 | 157 | pdf.structure(:Span, ActualText: 'Selected') do |
158 | | - pdf.text 'X' |
| 158 | + pdf.text('X') |
159 | 159 | end |
160 | 160 | pdf.structure(:Span, ActualText: 'Not selected') do |
161 | | - pdf.text ' ' |
| 161 | + pdf.text(' ') |
162 | 162 | end |
163 | 163 | output = pdf.render |
164 | 164 |
|
|
169 | 169 | describe '#figure' do |
170 | 170 | it 'wraps content with alt text' do |
171 | 171 | pdf.figure(alt_text: 'A logo') do |
172 | | - pdf.text 'IMAGE PLACEHOLDER' |
| 172 | + pdf.text('IMAGE PLACEHOLDER') |
173 | 173 | end |
174 | 174 | output = pdf.render |
175 | 175 |
|
|
184 | 184 | pdf.paragraph('This is a test paragraph.') |
185 | 185 |
|
186 | 186 | pdf.artifact(type: :Pagination) do |
187 | | - pdf.text 'Page 1 of 1' |
| 187 | + pdf.text('Page 1 of 1') |
188 | 188 | end |
189 | 189 |
|
190 | 190 | output = pdf.render |
|
0 commit comments