openxml-docx 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/examples/booklet-printing +55 -0
- data/lib/openxml/docx/attribute_builder.rb +11 -5
- data/lib/openxml/docx/elements/absolute_position_tab.rb +1 -1
- data/lib/openxml/docx/elements/background.rb +16 -0
- data/lib/openxml/docx/elements/book_fold_printing.rb +1 -1
- data/lib/openxml/docx/elements/book_fold_reverse_printing.rb +1 -1
- data/lib/openxml/docx/elements/compatibility_setting.rb +10 -0
- data/lib/openxml/docx/elements/compatibility_settings.rb +15 -0
- data/lib/openxml/docx/elements/embed_bold.rb +2 -10
- data/lib/openxml/docx/elements/embed_bold_italic.rb +2 -10
- data/lib/openxml/docx/elements/embed_italic.rb +2 -10
- data/lib/openxml/docx/elements/embed_regular.rb +3 -3
- data/lib/openxml/docx/elements/embed_system_fonts.rb +1 -1
- data/lib/openxml/docx/elements/embed_true_type_fonts.rb +1 -1
- data/lib/openxml/docx/elements/even_and_odd_headers.rb +11 -0
- data/lib/openxml/docx/elements/family.rb +1 -1
- data/lib/openxml/docx/elements/markup_compatibility_choice.rb +1 -1
- data/lib/openxml/docx/elements/paragraph.rb +1 -0
- data/lib/openxml/docx/elements/save_subset_fonts.rb +1 -1
- data/lib/openxml/docx/elements/table_cell.rb +1 -0
- data/lib/openxml/docx/elements/textbox_content.rb +9 -0
- data/lib/openxml/docx/elements/word_processing_drawing_anchor.rb +6 -6
- data/lib/openxml/docx/elements/word_processing_drawing_inline.rb +16 -0
- data/lib/openxml/docx/elements/word_processing_drawing_object_nv_properties.rb +1 -1
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_polygon.rb +1 -1
- data/lib/openxml/docx/elements/word_processing_shapes_body_properties.rb +12 -12
- data/lib/openxml/docx/elements/word_processing_shapes_nv_drawing_properties.rb +1 -1
- data/lib/openxml/docx/elements/word_processing_shapes_shape.rb +1 -2
- data/lib/openxml/docx/elements/word_processing_shapes_shape_properties.rb +1 -11
- data/lib/openxml/docx/elements/word_processing_shapes_textual_contents.rb +13 -0
- data/lib/openxml/{drawingml → docx}/elements/wordprocessing_shape_group.rb +1 -1
- data/lib/openxml/docx/package.rb +4 -3
- data/lib/openxml/docx/parts/document.rb +5 -0
- data/lib/openxml/docx/parts/header.rb +1 -1
- data/lib/openxml/docx/properties.rb +1 -0
- data/lib/openxml/docx/properties/border.rb +2 -2
- data/lib/openxml/docx/properties/columns.rb +8 -2
- data/lib/openxml/docx/properties/conditional_formatting.rb +12 -12
- data/lib/openxml/docx/properties/container_property.rb +10 -10
- data/lib/openxml/docx/properties/footer_references.rb +12 -0
- data/lib/openxml/docx/properties/frame.rb +1 -1
- data/lib/openxml/docx/properties/header_references.rb +12 -0
- data/lib/openxml/docx/properties/indentation.rb +5 -1
- data/lib/openxml/docx/properties/latent_styles.rb +4 -4
- data/lib/openxml/docx/properties/latent_styles_exception.rb +4 -4
- data/lib/openxml/docx/properties/section.rb +15 -0
- data/lib/openxml/docx/properties/table_border.rb +2 -2
- data/lib/openxml/docx/properties/table_cell_border.rb +2 -2
- data/lib/openxml/docx/properties/table_look.rb +7 -6
- data/lib/openxml/docx/properties/text_direction.rb +1 -1
- data/lib/openxml/docx/properties/transparent_container_property.rb +14 -0
- data/lib/openxml/docx/properties/vertical_merge.rb +14 -0
- data/lib/openxml/docx/section.rb +2 -0
- data/lib/openxml/docx/style.rb +18 -6
- data/lib/openxml/docx/version.rb +1 -1
- data/lib/openxml/drawingml/elements/blip_fill.rb +1 -1
- data/lib/openxml/drawingml/elements/children_extents.rb +14 -0
- data/lib/openxml/drawingml/elements/children_offset.rb +14 -0
- data/lib/openxml/drawingml/elements/graphic_frame_locks.rb +6 -6
- data/lib/openxml/drawingml/elements/no_autofit.rb +10 -0
- data/lib/openxml/drawingml/elements/no_fill.rb +1 -1
- data/lib/openxml/drawingml/elements/non_visual_drawing_properties.rb +1 -1
- data/lib/openxml/drawingml/elements/non_visual_picture_drawing_properties.rb +1 -1
- data/lib/openxml/drawingml/elements/non_visual_shape_drawing_properties.rb +12 -0
- data/lib/openxml/drawingml/elements/picture_locks.rb +11 -11
- data/lib/openxml/drawingml/elements/preset_text_warp.rb +25 -0
- data/lib/openxml/vml/elements/group.rb +17 -37
- data/lib/openxml/vml/elements/rectangle.rb +29 -62
- data/lib/openxml/vml/elements/rounded_rectangle.rb +29 -61
- data/spec/elements/absolute_position_tab_spec.rb +21 -15
- data/spec/elements/background_spec.rb +52 -0
- data/spec/elements/bidi_embed_spec.rb +12 -4
- data/spec/elements/bidi_override_spec.rb +12 -4
- data/spec/elements/break_spec.rb +12 -10
- data/spec/elements/compatibility_setting_spec.rb +41 -0
- data/spec/elements/compatibility_settings_spec.rb +8 -0
- data/spec/elements/content_part_spec.rb +2 -2
- data/spec/elements/control_spec.rb +5 -5
- data/spec/elements/deleted_text_spec.rb +2 -2
- data/spec/elements/drawingml/blip_fill_spec.rb +8 -3
- data/spec/elements/drawingml/extents_spec.rb +4 -4
- data/spec/elements/drawingml/head_end_spec.rb +16 -13
- data/spec/elements/drawingml/no_autofit_spec.rb +8 -0
- data/spec/elements/drawingml/non_visual_drawing_properties_spec.rb +6 -6
- data/spec/elements/drawingml/non_visual_shape_drawing_properties_spec.rb +24 -0
- data/spec/elements/drawingml/offset_spec.rb +14 -4
- data/spec/elements/drawingml/outline_spec.rb +20 -14
- data/spec/elements/drawingml/preset_geometry_spec.rb +1 -1
- data/spec/elements/drawingml/preset_text_warp_spec.rb +36 -0
- data/spec/elements/drawingml/shape_guide_spec.rb +7 -3
- data/spec/elements/drawingml/srgb_color_spec.rb +3 -4
- data/spec/elements/drawingml/tail_end_spec.rb +17 -14
- data/spec/elements/drawingml/transform_effect_spec.rb +48 -26
- data/spec/elements/markup_compatibility_choice_spec.rb +2 -2
- data/spec/elements/paragraph_spec.rb +25 -0
- data/spec/elements/symbol_spec.rb +4 -4
- data/spec/elements/text_spec.rb +1 -1
- data/spec/elements/textbox_content_spec.rb +8 -0
- data/spec/elements/vml/group_spec.rb +367 -375
- data/spec/elements/vml/rectangle_spec.rb +503 -513
- data/spec/elements/vml/rounded_rectangle_spec.rb +591 -463
- data/spec/elements/word_processing_drawing_effect_extent_spec.rb +32 -12
- data/spec/elements/word_processing_drawing_extent_spec.rb +4 -4
- data/spec/elements/word_processing_drawing_object_nv_properties_spec.rb +6 -6
- data/spec/elements/word_processing_drawing_simple_position_spec.rb +16 -6
- data/spec/elements/word_processing_shapes_body_properties_spec.rb +53 -44
- data/spec/elements/word_processing_shapes_shape_properties_spec.rb +6 -5
- data/spec/elements/word_processing_shapes_shape_spec.rb +2 -2
- data/spec/elements/word_processing_shapes_textual_content_spec.rb +23 -0
- data/spec/elements/{drawingml/wordprocessing_shape_group_spec.rb → wordprocessing_shape_group_spec.rb} +1 -1
- data/spec/properties/indentation_spec.rb +28 -0
- data/spec/properties/table_look_spec.rb +5 -0
- data/spec/properties/text_direction_spec.rb +5 -0
- data/spec/properties/vertical_merge_spec.rb +22 -0
- data/spec/support/data/elements/paragraph_with_section_properties_element.xml +12 -0
- data/spec/support/data/parts/empty_header_part.xml +1 -1
- data/spec/support/data/parts/header_with_children_part.xml +1 -1
- metadata +76 -27
- checksums.yaml +0 -7
data/spec/elements/text_spec.rb
CHANGED
@@ -6,537 +6,529 @@ describe OpenXml::Vml::Elements::Group do
|
|
6
6
|
it_should_use tag: :group, name: "group"
|
7
7
|
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
describe "HR Align Attribute" do
|
10
|
+
for_attribute(:hr_align, displays_as: :hralign, with_namespace: :o) do
|
11
|
+
%i(center left right).each do |value|
|
12
|
+
with_value(value) do
|
13
|
+
it_should_assign_successfully
|
14
|
+
it_should_output "<v:group o:hralign=\"#{value}\"/>"
|
15
|
+
end
|
16
16
|
end
|
17
|
-
end
|
18
17
|
|
19
|
-
|
20
|
-
|
18
|
+
with_values([:justified, 4, "overThere"]) do
|
19
|
+
it_should_raise_an_exception
|
20
|
+
end
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
+
describe "Inset Mode Attribute" do
|
25
|
+
for_attribute(:inset_mode, displays_as: :insetmode, with_namespace: :o) do
|
26
|
+
with_value(:auto) do
|
27
|
+
it_should_assign_successfully
|
28
|
+
it_should_output "<v:group o:insetmode=\"auto\"/>"
|
29
|
+
end
|
24
30
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
it_should_assign_successfully
|
30
|
-
it_should_output "<v:group o:insetmode=\"auto\"/>"
|
31
|
-
end
|
32
|
-
|
33
|
-
with_value(:custom) do
|
34
|
-
it_should_assign_successfully
|
35
|
-
it_should_output "<v:group o:insetmode=\"custom\"/>"
|
36
|
-
end
|
31
|
+
with_value(:custom) do
|
32
|
+
it_should_assign_successfully
|
33
|
+
it_should_output "<v:group o:insetmode=\"custom\"/>"
|
34
|
+
end
|
37
35
|
|
38
|
-
|
39
|
-
|
36
|
+
with_values([:left, "right", 0]) do
|
37
|
+
it_should_raise_an_exception
|
38
|
+
end
|
40
39
|
end
|
41
40
|
end
|
42
41
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
it_should_output "<v:group editas=\"#{value}\"/>"
|
42
|
+
describe "Edit As Attribute" do
|
43
|
+
for_attribute(:edit_as, displays_as: :editas) do
|
44
|
+
%i(bullseye canvas cycle orgchart radial stacked venn).each do |value|
|
45
|
+
with_value(value) do
|
46
|
+
it_should_assign_successfully
|
47
|
+
it_should_output "<v:group editas=\"#{value}\"/>"
|
48
|
+
end
|
51
49
|
end
|
52
|
-
end
|
53
50
|
|
54
|
-
|
55
|
-
|
51
|
+
with_values([:piechart, 4, "amazingGraph"]) do
|
52
|
+
it_should_raise_an_exception
|
53
|
+
end
|
56
54
|
end
|
57
55
|
end
|
58
56
|
|
57
|
+
describe "Coordinate-based Attributes" do
|
58
|
+
good_coord_values = [ "100,100", "-100,-100", "100,-100", "100, 100", "-100, -100", "100, -100" ]
|
59
|
+
bad_coord_values = [ "100 100", "x:10,y:10", :over_there ]
|
59
60
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
good_coord_values.each do |good_value|
|
67
|
-
with_value(good_value) do
|
68
|
-
it_should_assign_successfully
|
69
|
-
it_should_output "<v:group coordorigin=\"#{good_value}\"/>"
|
61
|
+
for_attribute(:coordinate_origin, displays_as: :coordorigin) do
|
62
|
+
good_coord_values.each do |good_value|
|
63
|
+
with_value(good_value) do
|
64
|
+
it_should_assign_successfully
|
65
|
+
it_should_output "<v:group coordorigin=\"#{good_value}\"/>"
|
66
|
+
end
|
70
67
|
end
|
71
|
-
end
|
72
68
|
|
73
|
-
|
74
|
-
|
69
|
+
with_values(bad_coord_values) do
|
70
|
+
it_should_raise_an_exception
|
71
|
+
end
|
75
72
|
end
|
76
|
-
end
|
77
73
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
74
|
+
for_attribute(:coordinate_size, displays_as: :coordsize) do
|
75
|
+
good_coord_values.each do |good_value|
|
76
|
+
with_value(good_value) do
|
77
|
+
it_should_assign_successfully
|
78
|
+
it_should_output "<v:group coordsize=\"#{good_value}\"/>"
|
79
|
+
end
|
83
80
|
end
|
84
|
-
end
|
85
81
|
|
86
|
-
|
87
|
-
|
82
|
+
with_values(bad_coord_values) do
|
83
|
+
it_should_raise_an_exception
|
84
|
+
end
|
88
85
|
end
|
89
86
|
end
|
90
87
|
|
88
|
+
describe "Color-based Attributes" do
|
89
|
+
good_color_values = [ "#FFFFFF", :red, "palateEntry [0]", "palateEntry" ]
|
90
|
+
bad_color_values = [ 54, 0 ]
|
91
91
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
good_color_values.each do |good_value|
|
99
|
-
with_value(good_value) do
|
100
|
-
it_should_assign_successfully
|
101
|
-
it_should_output "<v:group fillcolor=\"#{good_value}\"/>"
|
92
|
+
for_attribute(:fill_color, displays_as: :fillcolor) do
|
93
|
+
good_color_values.each do |good_value|
|
94
|
+
with_value(good_value) do
|
95
|
+
it_should_assign_successfully
|
96
|
+
it_should_output "<v:group fillcolor=\"#{good_value}\"/>"
|
97
|
+
end
|
102
98
|
end
|
103
|
-
end
|
104
99
|
|
105
|
-
|
106
|
-
|
100
|
+
with_values(bad_color_values) do
|
101
|
+
it_should_raise_an_exception
|
102
|
+
end
|
107
103
|
end
|
108
104
|
end
|
109
105
|
|
106
|
+
describe "Diagram Layout-based Attributes" do
|
107
|
+
good_diagram_layout_values = (0..3)
|
108
|
+
bad_diagram_layout_values = [ -1, 4, "Five is Right Out" ]
|
110
109
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
good_diagram_layout_values.each do |good_value|
|
118
|
-
with_value(good_value) do
|
119
|
-
it_should_assign_successfully
|
120
|
-
it_should_output "<v:group o:dgmlayout=\"#{good_value}\"/>"
|
110
|
+
for_attribute(:diagram_node_layout, displays_as: :dgmlayout, with_namespace: :o) do
|
111
|
+
good_diagram_layout_values.each do |good_value|
|
112
|
+
with_value(good_value) do
|
113
|
+
it_should_assign_successfully
|
114
|
+
it_should_output "<v:group o:dgmlayout=\"#{good_value}\"/>"
|
115
|
+
end
|
121
116
|
end
|
122
|
-
end
|
123
117
|
|
124
|
-
|
125
|
-
|
118
|
+
with_values(bad_diagram_layout_values) do
|
119
|
+
it_should_raise_an_exception
|
120
|
+
end
|
126
121
|
end
|
127
|
-
end
|
128
122
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
123
|
+
for_attribute(:diagram_node_recent_layout, displays_as: :dgmlayoutmru, with_namespace: :o) do
|
124
|
+
good_diagram_layout_values.each do |good_value|
|
125
|
+
with_value(good_value) do
|
126
|
+
it_should_assign_successfully
|
127
|
+
it_should_output "<v:group o:dgmlayoutmru=\"#{good_value}\"/>"
|
128
|
+
end
|
134
129
|
end
|
135
|
-
end
|
136
130
|
|
137
|
-
|
138
|
-
|
131
|
+
with_values(bad_diagram_layout_values) do
|
132
|
+
it_should_raise_an_exception
|
133
|
+
end
|
139
134
|
end
|
140
135
|
end
|
141
136
|
|
137
|
+
describe "Integer-based Attributes" do
|
138
|
+
good_integer_values = [1, -1, 0]
|
139
|
+
bad_integer_values = [2.5, :five, "five"]
|
142
140
|
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
good_integer_values.each do |good_value|
|
150
|
-
with_value(good_value) do
|
151
|
-
it_should_assign_successfully
|
152
|
-
it_should_output "<v:group o:dgmnodekind=\"#{good_value}\"/>"
|
141
|
+
for_attribute(:diagram_node_kind, displays_as: :dgmnodekind, with_namespace: :o) do
|
142
|
+
good_integer_values.each do |good_value|
|
143
|
+
with_value(good_value) do
|
144
|
+
it_should_assign_successfully
|
145
|
+
it_should_output "<v:group o:dgmnodekind=\"#{good_value}\"/>"
|
146
|
+
end
|
153
147
|
end
|
154
|
-
end
|
155
148
|
|
156
|
-
|
157
|
-
|
149
|
+
with_values(bad_integer_values) do
|
150
|
+
it_should_raise_an_exception
|
151
|
+
end
|
158
152
|
end
|
159
|
-
end
|
160
153
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
154
|
+
for_attribute(:hr_percent, displays_as: :hrpct, with_namespace: :o) do
|
155
|
+
good_integer_values.each do |good_value|
|
156
|
+
with_value(good_value) do
|
157
|
+
it_should_assign_successfully
|
158
|
+
it_should_output "<v:group o:hrpct=\"#{good_value}\"/>"
|
159
|
+
end
|
166
160
|
end
|
167
|
-
end
|
168
161
|
|
169
|
-
|
170
|
-
|
162
|
+
with_values(bad_integer_values) do
|
163
|
+
it_should_raise_an_exception
|
164
|
+
end
|
171
165
|
end
|
172
|
-
end
|
173
166
|
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
167
|
+
for_attribute(:regroup_id, displays_as: :regroupid, with_namespace: :o) do
|
168
|
+
good_integer_values.each do |good_value|
|
169
|
+
with_value(good_value) do
|
170
|
+
it_should_assign_successfully
|
171
|
+
it_should_output "<v:group o:regroupid=\"#{good_value}\"/>"
|
172
|
+
end
|
179
173
|
end
|
180
|
-
end
|
181
174
|
|
182
|
-
|
183
|
-
|
175
|
+
with_values(bad_integer_values) do
|
176
|
+
it_should_raise_an_exception
|
177
|
+
end
|
184
178
|
end
|
185
179
|
end
|
186
180
|
|
181
|
+
describe "String-based Attributes" do
|
182
|
+
bad_string_values = [0, :nope, false]
|
187
183
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
with_value("String") do
|
194
|
-
it_should_assign_successfully
|
195
|
-
it_should_output "<v:group alt=\"String\"/>"
|
196
|
-
end
|
184
|
+
for_attribute(:alt) do
|
185
|
+
with_value("String") do
|
186
|
+
it_should_assign_successfully
|
187
|
+
it_should_output "<v:group alt=\"String\"/>"
|
188
|
+
end
|
197
189
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
190
|
+
with_value("000001f") do
|
191
|
+
it_should_assign_successfully
|
192
|
+
it_should_output "<v:group alt=\"000001f\"/>"
|
193
|
+
end
|
202
194
|
|
203
195
|
|
204
|
-
|
205
|
-
|
196
|
+
with_values(bad_string_values) do
|
197
|
+
it_should_raise_an_exception
|
198
|
+
end
|
206
199
|
end
|
207
|
-
end
|
208
200
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
201
|
+
for_attribute(:css_class, displays_as: :class) do
|
202
|
+
with_value("String") do
|
203
|
+
it_should_assign_successfully
|
204
|
+
it_should_output "<v:group class=\"String\"/>"
|
205
|
+
end
|
214
206
|
|
215
|
-
|
216
|
-
|
207
|
+
with_values(bad_string_values) do
|
208
|
+
it_should_raise_an_exception
|
209
|
+
end
|
217
210
|
end
|
218
|
-
end
|
219
211
|
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
212
|
+
for_attribute(:href) do
|
213
|
+
with_value("http://something.com") do
|
214
|
+
it_should_assign_successfully
|
215
|
+
it_should_output "<v:group href=\"http://something.com\"/>"
|
216
|
+
end
|
225
217
|
|
226
|
-
|
227
|
-
|
218
|
+
with_values(bad_string_values) do
|
219
|
+
it_should_raise_an_exception
|
220
|
+
end
|
228
221
|
end
|
229
|
-
end
|
230
222
|
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
223
|
+
for_attribute(:id) do
|
224
|
+
with_value("String") do
|
225
|
+
it_should_assign_successfully
|
226
|
+
it_should_output "<v:group id=\"String\"/>"
|
227
|
+
end
|
236
228
|
|
237
|
-
|
238
|
-
|
229
|
+
with_values(bad_string_values) do
|
230
|
+
it_should_raise_an_exception
|
231
|
+
end
|
239
232
|
end
|
240
|
-
end
|
241
233
|
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
234
|
+
for_attribute(:style) do
|
235
|
+
with_value("String") do
|
236
|
+
it_should_assign_successfully
|
237
|
+
it_should_output "<v:group style=\"String\"/>"
|
238
|
+
end
|
247
239
|
|
248
|
-
|
249
|
-
|
240
|
+
with_values(bad_string_values) do
|
241
|
+
it_should_raise_an_exception
|
242
|
+
end
|
250
243
|
end
|
251
|
-
end
|
252
244
|
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
245
|
+
for_attribute(:target) do
|
246
|
+
with_value("String") do
|
247
|
+
it_should_assign_successfully
|
248
|
+
it_should_output "<v:group target=\"String\"/>"
|
249
|
+
end
|
258
250
|
|
259
|
-
|
260
|
-
|
251
|
+
with_values(bad_string_values) do
|
252
|
+
it_should_raise_an_exception
|
253
|
+
end
|
261
254
|
end
|
262
|
-
end
|
263
255
|
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
256
|
+
for_attribute(:title) do
|
257
|
+
with_value("String") do
|
258
|
+
it_should_assign_successfully
|
259
|
+
it_should_output "<v:group title=\"String\"/>"
|
260
|
+
end
|
269
261
|
|
270
|
-
|
271
|
-
|
262
|
+
with_values(bad_string_values) do
|
263
|
+
it_should_raise_an_exception
|
264
|
+
end
|
272
265
|
end
|
273
|
-
end
|
274
266
|
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
267
|
+
for_attribute(:wrap_coordinates, displays_as: :wrapcoords) do
|
268
|
+
with_value("String") do
|
269
|
+
it_should_assign_successfully
|
270
|
+
it_should_output "<v:group wrapcoords=\"String\"/>"
|
271
|
+
end
|
280
272
|
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
273
|
+
with_value("0,0,100,100") do
|
274
|
+
it_should_assign_successfully
|
275
|
+
it_should_output "<v:group wrapcoords=\"0,0,100,100\"/>"
|
276
|
+
end
|
285
277
|
|
286
|
-
|
287
|
-
|
278
|
+
with_values(bad_string_values) do
|
279
|
+
it_should_raise_an_exception
|
280
|
+
end
|
288
281
|
end
|
289
|
-
end
|
290
282
|
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
283
|
+
for_attribute(:border_bottom_color, displays_as: :borderbottomcolor, with_namespace: :o) do
|
284
|
+
with_value("String") do
|
285
|
+
it_should_assign_successfully
|
286
|
+
it_should_output "<v:group o:borderbottomcolor=\"String\"/>"
|
287
|
+
end
|
296
288
|
|
297
|
-
|
298
|
-
|
289
|
+
with_values(bad_string_values) do
|
290
|
+
it_should_raise_an_exception
|
291
|
+
end
|
299
292
|
end
|
300
|
-
end
|
301
293
|
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
294
|
+
for_attribute(:border_left_color, displays_as: :borderleftcolor, with_namespace: :o) do
|
295
|
+
with_value("String") do
|
296
|
+
it_should_assign_successfully
|
297
|
+
it_should_output "<v:group o:borderleftcolor=\"String\"/>"
|
298
|
+
end
|
307
299
|
|
308
|
-
|
309
|
-
|
300
|
+
with_values(bad_string_values) do
|
301
|
+
it_should_raise_an_exception
|
302
|
+
end
|
310
303
|
end
|
311
|
-
end
|
312
304
|
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
305
|
+
for_attribute(:border_right_color, displays_as: :borderrightcolor, with_namespace: :o) do
|
306
|
+
with_value("String") do
|
307
|
+
it_should_assign_successfully
|
308
|
+
it_should_output "<v:group o:borderrightcolor=\"String\"/>"
|
309
|
+
end
|
318
310
|
|
319
|
-
|
320
|
-
|
311
|
+
with_values(bad_string_values) do
|
312
|
+
it_should_raise_an_exception
|
313
|
+
end
|
321
314
|
end
|
322
|
-
end
|
323
315
|
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
316
|
+
for_attribute(:border_top_color, displays_as: :bordertopcolor, with_namespace: :o) do
|
317
|
+
with_value("String") do
|
318
|
+
it_should_assign_successfully
|
319
|
+
it_should_output "<v:group o:bordertopcolor=\"String\"/>"
|
320
|
+
end
|
329
321
|
|
330
|
-
|
331
|
-
|
322
|
+
with_values(bad_string_values) do
|
323
|
+
it_should_raise_an_exception
|
324
|
+
end
|
332
325
|
end
|
333
|
-
end
|
334
326
|
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
327
|
+
for_attribute(:optional_string, displays_as: :spid, with_namespace: :o) do
|
328
|
+
with_value("String") do
|
329
|
+
it_should_assign_successfully
|
330
|
+
it_should_output "<v:group o:spid=\"String\"/>"
|
331
|
+
end
|
340
332
|
|
341
|
-
|
342
|
-
|
333
|
+
with_values(bad_string_values) do
|
334
|
+
it_should_raise_an_exception
|
335
|
+
end
|
343
336
|
end
|
344
|
-
end
|
345
337
|
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
338
|
+
for_attribute(:table_limits, displays_as: :tablelimits, with_namespace: :o) do
|
339
|
+
with_value("String") do
|
340
|
+
it_should_assign_successfully
|
341
|
+
it_should_output "<v:group o:tablelimits=\"String\"/>"
|
342
|
+
end
|
351
343
|
|
352
|
-
|
353
|
-
|
344
|
+
with_values(bad_string_values) do
|
345
|
+
it_should_raise_an_exception
|
346
|
+
end
|
354
347
|
end
|
355
|
-
end
|
356
348
|
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
349
|
+
for_attribute(:table_properties, displays_as: :tableproperties, with_namespace: :o) do
|
350
|
+
with_value("String") do
|
351
|
+
it_should_assign_successfully
|
352
|
+
it_should_output "<v:group o:tableproperties=\"String\"/>"
|
353
|
+
end
|
362
354
|
|
363
|
-
|
364
|
-
|
355
|
+
with_values(bad_string_values) do
|
356
|
+
it_should_raise_an_exception
|
357
|
+
end
|
365
358
|
end
|
366
359
|
end
|
367
360
|
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
bad_tf_values = ["yes", "no", "on", "off", 5]
|
361
|
+
describe "(Explicitly) True/False-based Attributes" do
|
362
|
+
good_tf_values = [true, false]
|
363
|
+
bad_tf_values = ["yes", "no", "on", "off", 5]
|
372
364
|
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
365
|
+
for_attribute(:filled) do
|
366
|
+
good_tf_values.each do |good_value|
|
367
|
+
with_value(good_value) do
|
368
|
+
it_should_assign_successfully
|
369
|
+
it_should_output "<v:group filled=\"#{good_value}\"/>"
|
370
|
+
end
|
378
371
|
end
|
379
|
-
end
|
380
372
|
|
381
|
-
|
382
|
-
|
373
|
+
with_values(bad_tf_values) do
|
374
|
+
it_should_raise_an_exception
|
375
|
+
end
|
383
376
|
end
|
384
|
-
end
|
385
377
|
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
378
|
+
for_attribute(:print) do
|
379
|
+
good_tf_values.each do |good_value|
|
380
|
+
with_value(good_value) do
|
381
|
+
it_should_assign_successfully
|
382
|
+
it_should_output "<v:group print=\"#{good_value}\"/>"
|
383
|
+
end
|
391
384
|
end
|
392
|
-
end
|
393
385
|
|
394
|
-
|
395
|
-
|
386
|
+
with_values(bad_tf_values) do
|
387
|
+
it_should_raise_an_exception
|
388
|
+
end
|
396
389
|
end
|
397
|
-
end
|
398
390
|
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
391
|
+
for_attribute(:allow_in_cell, displays_as: :allowincell, with_namespace: :o) do
|
392
|
+
good_tf_values.each do |good_value|
|
393
|
+
with_value(good_value) do
|
394
|
+
it_should_assign_successfully
|
395
|
+
it_should_output "<v:group o:allowincell=\"#{good_value}\"/>"
|
396
|
+
end
|
397
|
+
end
|
398
|
+
with_values(bad_tf_values) do
|
399
|
+
it_should_raise_an_exception
|
404
400
|
end
|
405
401
|
end
|
406
|
-
with_values(bad_tf_values) do
|
407
|
-
it_should_raise_an_exception
|
408
|
-
end
|
409
|
-
end
|
410
402
|
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
403
|
+
for_attribute(:allow_overlap, displays_as: :allowoverlap, with_namespace: :o) do
|
404
|
+
good_tf_values.each do |good_value|
|
405
|
+
with_value(good_value) do
|
406
|
+
it_should_assign_successfully
|
407
|
+
it_should_output "<v:group o:allowoverlap=\"#{good_value}\"/>"
|
408
|
+
end
|
416
409
|
end
|
417
|
-
end
|
418
410
|
|
419
|
-
|
420
|
-
|
411
|
+
with_values(bad_tf_values) do
|
412
|
+
it_should_raise_an_exception
|
413
|
+
end
|
421
414
|
end
|
422
|
-
end
|
423
415
|
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
416
|
+
for_attribute(:bullet, with_namespace: :o) do
|
417
|
+
good_tf_values.each do |good_value|
|
418
|
+
with_value(good_value) do
|
419
|
+
it_should_assign_successfully
|
420
|
+
it_should_output "<v:group o:bullet=\"#{good_value}\"/>"
|
421
|
+
end
|
429
422
|
end
|
430
|
-
end
|
431
423
|
|
432
|
-
|
433
|
-
|
424
|
+
with_values(bad_tf_values) do
|
425
|
+
it_should_raise_an_exception
|
426
|
+
end
|
434
427
|
end
|
435
|
-
end
|
436
428
|
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
429
|
+
for_attribute(:button, with_namespace: :o) do
|
430
|
+
good_tf_values.each do |good_value|
|
431
|
+
with_value(good_value) do
|
432
|
+
it_should_assign_successfully
|
433
|
+
it_should_output "<v:group o:button=\"#{good_value}\"/>"
|
434
|
+
end
|
442
435
|
end
|
443
|
-
end
|
444
436
|
|
445
|
-
|
446
|
-
|
437
|
+
with_values(bad_tf_values) do
|
438
|
+
it_should_raise_an_exception
|
439
|
+
end
|
447
440
|
end
|
448
|
-
end
|
449
441
|
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
442
|
+
for_attribute(:double_click_notify, displays_as: :doubleclicknotify, with_namespace: :o) do
|
443
|
+
good_tf_values.each do |good_value|
|
444
|
+
with_value(good_value) do
|
445
|
+
it_should_assign_successfully
|
446
|
+
it_should_output "<v:group o:doubleclicknotify=\"#{good_value}\"/>"
|
447
|
+
end
|
455
448
|
end
|
456
|
-
end
|
457
449
|
|
458
|
-
|
459
|
-
|
450
|
+
with_values(bad_tf_values) do
|
451
|
+
it_should_raise_an_exception
|
452
|
+
end
|
460
453
|
end
|
461
|
-
end
|
462
454
|
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
455
|
+
for_attribute(:hr, with_namespace: :o) do
|
456
|
+
good_tf_values.each do |good_value|
|
457
|
+
with_value(good_value) do
|
458
|
+
it_should_assign_successfully
|
459
|
+
it_should_output "<v:group o:hr=\"#{good_value}\"/>"
|
460
|
+
end
|
468
461
|
end
|
469
|
-
end
|
470
462
|
|
471
|
-
|
472
|
-
|
463
|
+
with_values(bad_tf_values) do
|
464
|
+
it_should_raise_an_exception
|
465
|
+
end
|
473
466
|
end
|
474
|
-
end
|
475
467
|
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
468
|
+
for_attribute(:hr_no_shade, displays_as: :hrnoshade, with_namespace: :o) do
|
469
|
+
good_tf_values.each do |good_value|
|
470
|
+
with_value(good_value) do
|
471
|
+
it_should_assign_successfully
|
472
|
+
it_should_output "<v:group o:hrnoshade=\"#{good_value}\"/>"
|
473
|
+
end
|
481
474
|
end
|
482
|
-
end
|
483
475
|
|
484
|
-
|
485
|
-
|
476
|
+
with_values(bad_tf_values) do
|
477
|
+
it_should_raise_an_exception
|
478
|
+
end
|
486
479
|
end
|
487
|
-
end
|
488
480
|
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
481
|
+
for_attribute(:hr_standard, displays_as: :hrstd, with_namespace: :o) do
|
482
|
+
good_tf_values.each do |good_value|
|
483
|
+
with_value(good_value) do
|
484
|
+
it_should_assign_successfully
|
485
|
+
it_should_output "<v:group o:hrstd=\"#{good_value}\"/>"
|
486
|
+
end
|
494
487
|
end
|
495
|
-
end
|
496
488
|
|
497
|
-
|
498
|
-
|
489
|
+
with_values(bad_tf_values) do
|
490
|
+
it_should_raise_an_exception
|
491
|
+
end
|
499
492
|
end
|
500
|
-
end
|
501
493
|
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
494
|
+
for_attribute(:hide_extra_handles, displays_as: :oned, with_namespace: :o) do
|
495
|
+
good_tf_values.each do |good_value|
|
496
|
+
with_value(good_value) do
|
497
|
+
it_should_assign_successfully
|
498
|
+
it_should_output "<v:group o:oned=\"#{good_value}\"/>"
|
499
|
+
end
|
507
500
|
end
|
508
|
-
end
|
509
501
|
|
510
|
-
|
511
|
-
|
502
|
+
with_values(bad_tf_values) do
|
503
|
+
it_should_raise_an_exception
|
504
|
+
end
|
512
505
|
end
|
513
|
-
end
|
514
506
|
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
507
|
+
for_attribute(:user_drawn, displays_as: :userdrawn, with_namespace: :o) do
|
508
|
+
good_tf_values.each do |good_value|
|
509
|
+
with_value(good_value) do
|
510
|
+
it_should_assign_successfully
|
511
|
+
it_should_output "<v:group o:userdrawn=\"#{good_value}\"/>"
|
512
|
+
end
|
520
513
|
end
|
521
|
-
end
|
522
514
|
|
523
|
-
|
524
|
-
|
515
|
+
with_values(bad_tf_values) do
|
516
|
+
it_should_raise_an_exception
|
517
|
+
end
|
525
518
|
end
|
526
|
-
end
|
527
519
|
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
520
|
+
for_attribute(:user_hidden, displays_as: :userhidden, with_namespace: :o) do
|
521
|
+
good_tf_values.each do |good_value|
|
522
|
+
with_value(good_value) do
|
523
|
+
it_should_assign_successfully
|
524
|
+
it_should_output "<v:group o:userhidden=\"#{good_value}\"/>"
|
525
|
+
end
|
533
526
|
end
|
534
|
-
end
|
535
527
|
|
536
|
-
|
537
|
-
|
528
|
+
with_values(bad_tf_values) do
|
529
|
+
it_should_raise_an_exception
|
530
|
+
end
|
538
531
|
end
|
539
532
|
end
|
540
533
|
|
541
|
-
|
542
534
|
end
|