openxml-docx 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. data/Gemfile.lock +1 -1
  2. data/examples/booklet-printing +55 -0
  3. data/lib/openxml/docx/attribute_builder.rb +11 -5
  4. data/lib/openxml/docx/elements/absolute_position_tab.rb +1 -1
  5. data/lib/openxml/docx/elements/background.rb +16 -0
  6. data/lib/openxml/docx/elements/book_fold_printing.rb +1 -1
  7. data/lib/openxml/docx/elements/book_fold_reverse_printing.rb +1 -1
  8. data/lib/openxml/docx/elements/compatibility_setting.rb +10 -0
  9. data/lib/openxml/docx/elements/compatibility_settings.rb +15 -0
  10. data/lib/openxml/docx/elements/embed_bold.rb +2 -10
  11. data/lib/openxml/docx/elements/embed_bold_italic.rb +2 -10
  12. data/lib/openxml/docx/elements/embed_italic.rb +2 -10
  13. data/lib/openxml/docx/elements/embed_regular.rb +3 -3
  14. data/lib/openxml/docx/elements/embed_system_fonts.rb +1 -1
  15. data/lib/openxml/docx/elements/embed_true_type_fonts.rb +1 -1
  16. data/lib/openxml/docx/elements/even_and_odd_headers.rb +11 -0
  17. data/lib/openxml/docx/elements/family.rb +1 -1
  18. data/lib/openxml/docx/elements/markup_compatibility_choice.rb +1 -1
  19. data/lib/openxml/docx/elements/paragraph.rb +1 -0
  20. data/lib/openxml/docx/elements/save_subset_fonts.rb +1 -1
  21. data/lib/openxml/docx/elements/table_cell.rb +1 -0
  22. data/lib/openxml/docx/elements/textbox_content.rb +9 -0
  23. data/lib/openxml/docx/elements/word_processing_drawing_anchor.rb +6 -6
  24. data/lib/openxml/docx/elements/word_processing_drawing_inline.rb +16 -0
  25. data/lib/openxml/docx/elements/word_processing_drawing_object_nv_properties.rb +1 -1
  26. data/lib/openxml/docx/elements/word_processing_drawing_wrap_polygon.rb +1 -1
  27. data/lib/openxml/docx/elements/word_processing_shapes_body_properties.rb +12 -12
  28. data/lib/openxml/docx/elements/word_processing_shapes_nv_drawing_properties.rb +1 -1
  29. data/lib/openxml/docx/elements/word_processing_shapes_shape.rb +1 -2
  30. data/lib/openxml/docx/elements/word_processing_shapes_shape_properties.rb +1 -11
  31. data/lib/openxml/docx/elements/word_processing_shapes_textual_contents.rb +13 -0
  32. data/lib/openxml/{drawingml → docx}/elements/wordprocessing_shape_group.rb +1 -1
  33. data/lib/openxml/docx/package.rb +4 -3
  34. data/lib/openxml/docx/parts/document.rb +5 -0
  35. data/lib/openxml/docx/parts/header.rb +1 -1
  36. data/lib/openxml/docx/properties.rb +1 -0
  37. data/lib/openxml/docx/properties/border.rb +2 -2
  38. data/lib/openxml/docx/properties/columns.rb +8 -2
  39. data/lib/openxml/docx/properties/conditional_formatting.rb +12 -12
  40. data/lib/openxml/docx/properties/container_property.rb +10 -10
  41. data/lib/openxml/docx/properties/footer_references.rb +12 -0
  42. data/lib/openxml/docx/properties/frame.rb +1 -1
  43. data/lib/openxml/docx/properties/header_references.rb +12 -0
  44. data/lib/openxml/docx/properties/indentation.rb +5 -1
  45. data/lib/openxml/docx/properties/latent_styles.rb +4 -4
  46. data/lib/openxml/docx/properties/latent_styles_exception.rb +4 -4
  47. data/lib/openxml/docx/properties/section.rb +15 -0
  48. data/lib/openxml/docx/properties/table_border.rb +2 -2
  49. data/lib/openxml/docx/properties/table_cell_border.rb +2 -2
  50. data/lib/openxml/docx/properties/table_look.rb +7 -6
  51. data/lib/openxml/docx/properties/text_direction.rb +1 -1
  52. data/lib/openxml/docx/properties/transparent_container_property.rb +14 -0
  53. data/lib/openxml/docx/properties/vertical_merge.rb +14 -0
  54. data/lib/openxml/docx/section.rb +2 -0
  55. data/lib/openxml/docx/style.rb +18 -6
  56. data/lib/openxml/docx/version.rb +1 -1
  57. data/lib/openxml/drawingml/elements/blip_fill.rb +1 -1
  58. data/lib/openxml/drawingml/elements/children_extents.rb +14 -0
  59. data/lib/openxml/drawingml/elements/children_offset.rb +14 -0
  60. data/lib/openxml/drawingml/elements/graphic_frame_locks.rb +6 -6
  61. data/lib/openxml/drawingml/elements/no_autofit.rb +10 -0
  62. data/lib/openxml/drawingml/elements/no_fill.rb +1 -1
  63. data/lib/openxml/drawingml/elements/non_visual_drawing_properties.rb +1 -1
  64. data/lib/openxml/drawingml/elements/non_visual_picture_drawing_properties.rb +1 -1
  65. data/lib/openxml/drawingml/elements/non_visual_shape_drawing_properties.rb +12 -0
  66. data/lib/openxml/drawingml/elements/picture_locks.rb +11 -11
  67. data/lib/openxml/drawingml/elements/preset_text_warp.rb +25 -0
  68. data/lib/openxml/vml/elements/group.rb +17 -37
  69. data/lib/openxml/vml/elements/rectangle.rb +29 -62
  70. data/lib/openxml/vml/elements/rounded_rectangle.rb +29 -61
  71. data/spec/elements/absolute_position_tab_spec.rb +21 -15
  72. data/spec/elements/background_spec.rb +52 -0
  73. data/spec/elements/bidi_embed_spec.rb +12 -4
  74. data/spec/elements/bidi_override_spec.rb +12 -4
  75. data/spec/elements/break_spec.rb +12 -10
  76. data/spec/elements/compatibility_setting_spec.rb +41 -0
  77. data/spec/elements/compatibility_settings_spec.rb +8 -0
  78. data/spec/elements/content_part_spec.rb +2 -2
  79. data/spec/elements/control_spec.rb +5 -5
  80. data/spec/elements/deleted_text_spec.rb +2 -2
  81. data/spec/elements/drawingml/blip_fill_spec.rb +8 -3
  82. data/spec/elements/drawingml/extents_spec.rb +4 -4
  83. data/spec/elements/drawingml/head_end_spec.rb +16 -13
  84. data/spec/elements/drawingml/no_autofit_spec.rb +8 -0
  85. data/spec/elements/drawingml/non_visual_drawing_properties_spec.rb +6 -6
  86. data/spec/elements/drawingml/non_visual_shape_drawing_properties_spec.rb +24 -0
  87. data/spec/elements/drawingml/offset_spec.rb +14 -4
  88. data/spec/elements/drawingml/outline_spec.rb +20 -14
  89. data/spec/elements/drawingml/preset_geometry_spec.rb +1 -1
  90. data/spec/elements/drawingml/preset_text_warp_spec.rb +36 -0
  91. data/spec/elements/drawingml/shape_guide_spec.rb +7 -3
  92. data/spec/elements/drawingml/srgb_color_spec.rb +3 -4
  93. data/spec/elements/drawingml/tail_end_spec.rb +17 -14
  94. data/spec/elements/drawingml/transform_effect_spec.rb +48 -26
  95. data/spec/elements/markup_compatibility_choice_spec.rb +2 -2
  96. data/spec/elements/paragraph_spec.rb +25 -0
  97. data/spec/elements/symbol_spec.rb +4 -4
  98. data/spec/elements/text_spec.rb +1 -1
  99. data/spec/elements/textbox_content_spec.rb +8 -0
  100. data/spec/elements/vml/group_spec.rb +367 -375
  101. data/spec/elements/vml/rectangle_spec.rb +503 -513
  102. data/spec/elements/vml/rounded_rectangle_spec.rb +591 -463
  103. data/spec/elements/word_processing_drawing_effect_extent_spec.rb +32 -12
  104. data/spec/elements/word_processing_drawing_extent_spec.rb +4 -4
  105. data/spec/elements/word_processing_drawing_object_nv_properties_spec.rb +6 -6
  106. data/spec/elements/word_processing_drawing_simple_position_spec.rb +16 -6
  107. data/spec/elements/word_processing_shapes_body_properties_spec.rb +53 -44
  108. data/spec/elements/word_processing_shapes_shape_properties_spec.rb +6 -5
  109. data/spec/elements/word_processing_shapes_shape_spec.rb +2 -2
  110. data/spec/elements/word_processing_shapes_textual_content_spec.rb +23 -0
  111. data/spec/elements/{drawingml/wordprocessing_shape_group_spec.rb → wordprocessing_shape_group_spec.rb} +1 -1
  112. data/spec/properties/indentation_spec.rb +28 -0
  113. data/spec/properties/table_look_spec.rb +5 -0
  114. data/spec/properties/text_direction_spec.rb +5 -0
  115. data/spec/properties/vertical_merge_spec.rb +22 -0
  116. data/spec/support/data/elements/paragraph_with_section_properties_element.xml +12 -0
  117. data/spec/support/data/parts/empty_header_part.xml +1 -1
  118. data/spec/support/data/parts/header_with_children_part.xml +1 -1
  119. metadata +76 -27
  120. checksums.yaml +0 -7
@@ -6,734 +6,724 @@ describe OpenXml::Vml::Elements::Rectangle do
6
6
  it_should_use tag: :rect, name: "rectangle"
7
7
 
8
8
 
9
- # Connector Type Attribute
10
-
11
- for_attribute(:connector_type, displays_as: :connectortype, with_namespace: :o) do
12
- %i(curved elbow none straight).each do |value|
13
- with_value(value) do
14
- it_should_assign_successfully
15
- it_should_output "<v:rect o:connectortype=\"#{value}\"/>"
9
+ describe "Connector Type Attribute" do
10
+ for_attribute(:connector_type, displays_as: :connectortype, with_namespace: :o) do
11
+ %i(curved elbow none straight).each do |value|
12
+ with_value(value) do
13
+ it_should_assign_successfully
14
+ it_should_output "<v:rect o:connectortype=\"#{value}\"/>"
15
+ end
16
16
  end
17
- end
18
17
 
19
- with_values([:funky, 5, "auto"]) do
20
- it_should_raise_an_exception
18
+ with_values([:funky, 5, "auto"]) do
19
+ it_should_raise_an_exception
20
+ end
21
21
  end
22
22
  end
23
23
 
24
-
25
- # HR Align Attribute
26
-
27
- for_attribute(:hr_align, displays_as: :hralign, with_namespace: :o) do
28
- %i(center left right).each do |value|
29
- with_value(value) do
30
- it_should_assign_successfully
31
- it_should_output "<v:rect o:hralign=\"#{value}\"/>"
24
+ describe "HR Align Attribute" do
25
+ for_attribute(:hr_align, displays_as: :hralign, with_namespace: :o) do
26
+ %i(center left right).each do |value|
27
+ with_value(value) do
28
+ it_should_assign_successfully
29
+ it_should_output "<v:rect o:hralign=\"#{value}\"/>"
30
+ end
32
31
  end
33
- end
34
32
 
35
- with_values([:justified, 4, "overThere"]) do
36
- it_should_raise_an_exception
33
+ with_values([:justified, 4, "overThere"]) do
34
+ it_should_raise_an_exception
35
+ end
37
36
  end
38
37
  end
39
38
 
39
+ describe "Inset Mode Attribute" do
40
+ for_attribute(:inset_mode, displays_as: :insetmode, with_namespace: :o) do
41
+ with_value(:auto) do
42
+ it_should_assign_successfully
43
+ it_should_output "<v:rect o:insetmode=\"auto\"/>"
44
+ end
40
45
 
41
- # Inset Mode Attribute
42
-
43
- for_attribute(:inset_mode, displays_as: :insetmode, with_namespace: :o) do
44
- with_value(:auto) do
45
- it_should_assign_successfully
46
- it_should_output "<v:rect o:insetmode=\"auto\"/>"
47
- end
48
-
49
- with_value(:custom) do
50
- it_should_assign_successfully
51
- it_should_output "<v:rect o:insetmode=\"custom\"/>"
52
- end
46
+ with_value(:custom) do
47
+ it_should_assign_successfully
48
+ it_should_output "<v:rect o:insetmode=\"custom\"/>"
49
+ end
53
50
 
54
- with_values([:left, "right", 0]) do
55
- it_should_raise_an_exception
51
+ with_values([:left, "right", 0]) 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
- # Coordinate-based Attributes
61
-
62
- good_coord_values = [ "100,100", "-100,-100", "100,-100", "100, 100", "-100, -100", "100, -100" ]
63
- bad_coord_values = [ "100 100", "x:10,y:10", :over_there ]
64
-
65
- for_attribute(:coordinate_origin, displays_as: :coordorigin) do
66
- good_coord_values.each do |good_value|
67
- with_value(good_value) do
68
- it_should_assign_successfully
69
- it_should_output "<v:rect 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:rect coordorigin=\"#{good_value}\"/>"
66
+ end
70
67
  end
71
- end
72
68
 
73
- with_values(bad_coord_values) do
74
- it_should_raise_an_exception
69
+ with_values(bad_coord_values) do
70
+ it_should_raise_an_exception
71
+ end
75
72
  end
76
- end
77
73
 
78
- for_attribute(:coordinate_size, displays_as: :coordsize) do
79
- good_coord_values.each do |good_value|
80
- with_value(good_value) do
81
- it_should_assign_successfully
82
- it_should_output "<v:rect coordsize=\"#{good_value}\"/>"
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:rect coordsize=\"#{good_value}\"/>"
79
+ end
83
80
  end
84
- end
85
81
 
86
- with_values(bad_coord_values) do
87
- it_should_raise_an_exception
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
- # Color-based Attributes
93
-
94
- good_color_values = [ "#FFFFFF", :red, "palateEntry [0]", "palateEntry" ]
95
- bad_color_values = [ 54, 0 ]
96
-
97
- for_attribute(:chroma_key, displays_as: :chromakey) do
98
- good_color_values.each do |good_value|
99
- with_value(good_value) do
100
- it_should_assign_successfully
101
- it_should_output "<v:rect chromakey=\"#{good_value}\"/>"
92
+ for_attribute(:chroma_key, displays_as: :chromakey) 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:rect chromakey=\"#{good_value}\"/>"
97
+ end
102
98
  end
103
- end
104
99
 
105
- with_values(bad_color_values) do
106
- it_should_raise_an_exception
100
+ with_values(bad_color_values) do
101
+ it_should_raise_an_exception
102
+ end
107
103
  end
108
- end
109
104
 
110
- for_attribute(:fill_color, displays_as: :fillcolor) do
111
- good_color_values.each do |good_value|
112
- with_value(good_value) do
113
- it_should_assign_successfully
114
- it_should_output "<v:rect fillcolor=\"#{good_value}\"/>"
105
+ for_attribute(:fill_color, displays_as: :fillcolor) do
106
+ good_color_values.each do |good_value|
107
+ with_value(good_value) do
108
+ it_should_assign_successfully
109
+ it_should_output "<v:rect fillcolor=\"#{good_value}\"/>"
110
+ end
115
111
  end
116
- end
117
112
 
118
- with_values(bad_color_values) do
119
- it_should_raise_an_exception
113
+ with_values(bad_color_values) do
114
+ it_should_raise_an_exception
115
+ end
120
116
  end
121
- end
122
117
 
123
- for_attribute(:stroke_color, displays_as: :strokecolor) do
124
- good_color_values.each do |good_value|
125
- with_value(good_value) do
126
- it_should_assign_successfully
127
- it_should_output "<v:rect strokecolor=\"#{good_value}\"/>"
118
+ for_attribute(:stroke_color, displays_as: :strokecolor) do
119
+ good_color_values.each do |good_value|
120
+ with_value(good_value) do
121
+ it_should_assign_successfully
122
+ it_should_output "<v:rect strokecolor=\"#{good_value}\"/>"
123
+ end
128
124
  end
129
- end
130
125
 
131
- with_values(bad_color_values) do
132
- it_should_raise_an_exception
126
+ with_values(bad_color_values) do
127
+ it_should_raise_an_exception
128
+ end
133
129
  end
134
130
  end
135
131
 
132
+ describe "Diagram Layout-based Attributes" do
133
+ good_diagram_layout_values = (0..3)
134
+ bad_diagram_layout_values = [ -1, 4, "Five is Right Out" ]
136
135
 
137
- # Diagram Layout-based Attributes
138
-
139
- good_diagram_layout_values = (0..3)
140
- bad_diagram_layout_values = [ -1, 4, "Five is Right Out" ]
141
-
142
- for_attribute(:diagram_node_layout, displays_as: :dgmlayout, with_namespace: :o) do
143
- good_diagram_layout_values.each do |good_value|
144
- with_value(good_value) do
145
- it_should_assign_successfully
146
- it_should_output "<v:rect o:dgmlayout=\"#{good_value}\"/>"
136
+ for_attribute(:diagram_node_layout, displays_as: :dgmlayout, with_namespace: :o) do
137
+ good_diagram_layout_values.each do |good_value|
138
+ with_value(good_value) do
139
+ it_should_assign_successfully
140
+ it_should_output "<v:rect o:dgmlayout=\"#{good_value}\"/>"
141
+ end
147
142
  end
148
- end
149
143
 
150
- with_values(bad_diagram_layout_values) do
151
- it_should_raise_an_exception
144
+ with_values(bad_diagram_layout_values) do
145
+ it_should_raise_an_exception
146
+ end
152
147
  end
153
- end
154
148
 
155
- for_attribute(:diagram_node_recent_layout, displays_as: :dgmlayoutmru, with_namespace: :o) do
156
- good_diagram_layout_values.each do |good_value|
157
- with_value(good_value) do
158
- it_should_assign_successfully
159
- it_should_output "<v:rect o:dgmlayoutmru=\"#{good_value}\"/>"
149
+ for_attribute(:diagram_node_recent_layout, displays_as: :dgmlayoutmru, with_namespace: :o) do
150
+ good_diagram_layout_values.each do |good_value|
151
+ with_value(good_value) do
152
+ it_should_assign_successfully
153
+ it_should_output "<v:rect o:dgmlayoutmru=\"#{good_value}\"/>"
154
+ end
160
155
  end
161
- end
162
156
 
163
- with_values(bad_diagram_layout_values) do
164
- it_should_raise_an_exception
157
+ with_values(bad_diagram_layout_values) do
158
+ it_should_raise_an_exception
159
+ end
165
160
  end
166
161
  end
167
162
 
163
+ describe "Integer-based Attributes" do
164
+ good_integer_values = [1, -1, 0]
165
+ bad_integer_values = [2.5, :five, "five"]
168
166
 
169
- # Integer-based Attributes
170
-
171
- good_integer_values = [1, -1, 0]
172
- bad_integer_values = [2.5, :five, "five"]
173
-
174
- for_attribute(:diagram_node_kind, displays_as: :dgmnodekind, with_namespace: :o) do
175
- good_integer_values.each do |good_value|
176
- with_value(good_value) do
177
- it_should_assign_successfully
178
- it_should_output "<v:rect o:dgmnodekind=\"#{good_value}\"/>"
167
+ for_attribute(:diagram_node_kind, displays_as: :dgmnodekind, 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:rect o:dgmnodekind=\"#{good_value}\"/>"
172
+ end
179
173
  end
180
- end
181
174
 
182
- with_values(bad_integer_values) do
183
- it_should_raise_an_exception
175
+ with_values(bad_integer_values) do
176
+ it_should_raise_an_exception
177
+ end
184
178
  end
185
- end
186
179
 
187
- for_attribute(:hr_percent, displays_as: :hrpct, with_namespace: :o) do
188
- good_integer_values.each do |good_value|
189
- with_value(good_value) do
190
- it_should_assign_successfully
191
- it_should_output "<v:rect o:hrpct=\"#{good_value}\"/>"
180
+ for_attribute(:hr_percent, displays_as: :hrpct, with_namespace: :o) do
181
+ good_integer_values.each do |good_value|
182
+ with_value(good_value) do
183
+ it_should_assign_successfully
184
+ it_should_output "<v:rect o:hrpct=\"#{good_value}\"/>"
185
+ end
192
186
  end
193
- end
194
187
 
195
- with_values(bad_integer_values) do
196
- it_should_raise_an_exception
188
+ with_values(bad_integer_values) do
189
+ it_should_raise_an_exception
190
+ end
197
191
  end
198
- end
199
192
 
200
- for_attribute(:regroup_id, displays_as: :regroupid, with_namespace: :o) do
201
- good_integer_values.each do |good_value|
202
- with_value(good_value) do
203
- it_should_assign_successfully
204
- it_should_output "<v:rect o:regroupid=\"#{good_value}\"/>"
193
+ for_attribute(:regroup_id, displays_as: :regroupid, with_namespace: :o) do
194
+ good_integer_values.each do |good_value|
195
+ with_value(good_value) do
196
+ it_should_assign_successfully
197
+ it_should_output "<v:rect o:regroupid=\"#{good_value}\"/>"
198
+ end
205
199
  end
206
- end
207
200
 
208
- with_values(bad_integer_values) do
209
- it_should_raise_an_exception
201
+ with_values(bad_integer_values) do
202
+ it_should_raise_an_exception
203
+ end
210
204
  end
211
205
  end
212
206
 
207
+ describe "Black and White Mode-based Attributes" do
208
+ good_bw_mode_values = %i(auto black blackTextAndLines color grayOutline grayScale hide highContrast inverseGray lightGrayscale undrawn white)
209
+ bad_bw_mode_values = [:paintItBlack, 0, "rainbows"]
213
210
 
214
- # Black and White Mode-based Attributes
215
-
216
- good_bw_mode_values = %i(auto black blackTextAndLines color grayOutline grayScale hide highContrast inverseGray lightGrayscale undrawn white)
217
- bad_bw_mode_values = [:paintItBlack, 0, "rainbows"]
218
-
219
- for_attribute(:bw_mode, displays_as: :bwmode, with_namespace: :o) do
220
- good_bw_mode_values.each do |good_value|
221
- with_value(good_value) do
222
- it_should_assign_successfully
223
- it_should_output "<v:rect o:bwmode=\"#{good_value}\"/>"
211
+ for_attribute(:bw_mode, displays_as: :bwmode, with_namespace: :o) do
212
+ good_bw_mode_values.each do |good_value|
213
+ with_value(good_value) do
214
+ it_should_assign_successfully
215
+ it_should_output "<v:rect o:bwmode=\"#{good_value}\"/>"
216
+ end
224
217
  end
225
- end
226
218
 
227
- with_values(bad_bw_mode_values) do
228
- it_should_raise_an_exception
219
+ with_values(bad_bw_mode_values) do
220
+ it_should_raise_an_exception
221
+ end
229
222
  end
230
- end
231
223
 
232
- for_attribute(:bw_normal, displays_as: :bwnormal, with_namespace: :o) do
233
- good_bw_mode_values.each do |good_value|
234
- with_value(good_value) do
235
- it_should_assign_successfully
236
- it_should_output "<v:rect o:bwnormal=\"#{good_value}\"/>"
224
+ for_attribute(:bw_normal, displays_as: :bwnormal, with_namespace: :o) do
225
+ good_bw_mode_values.each do |good_value|
226
+ with_value(good_value) do
227
+ it_should_assign_successfully
228
+ it_should_output "<v:rect o:bwnormal=\"#{good_value}\"/>"
229
+ end
237
230
  end
238
- end
239
231
 
240
- with_values(bad_bw_mode_values) do
241
- it_should_raise_an_exception
232
+ with_values(bad_bw_mode_values) do
233
+ it_should_raise_an_exception
234
+ end
242
235
  end
243
- end
244
236
 
245
- for_attribute(:bw_pure, displays_as: :bwpure, with_namespace: :o) do
246
- good_bw_mode_values.each do |good_value|
247
- with_value(good_value) do
248
- it_should_assign_successfully
249
- it_should_output "<v:rect o:bwpure=\"#{good_value}\"/>"
237
+ for_attribute(:bw_pure, displays_as: :bwpure, with_namespace: :o) do
238
+ good_bw_mode_values.each do |good_value|
239
+ with_value(good_value) do
240
+ it_should_assign_successfully
241
+ it_should_output "<v:rect o:bwpure=\"#{good_value}\"/>"
242
+ end
250
243
  end
251
- end
252
244
 
253
- with_values(bad_bw_mode_values) do
254
- it_should_raise_an_exception
245
+ with_values(bad_bw_mode_values) do
246
+ it_should_raise_an_exception
247
+ end
255
248
  end
256
249
  end
257
250
 
251
+ describe "String-based Attributes" do
252
+ bad_string_values = [0, :nope, false]
258
253
 
259
- # String-based Attributes
260
-
261
- bad_string_values = [0, :nope, false]
262
-
263
- for_attribute(:alt) do
264
- with_value("String") do
265
- it_should_assign_successfully
266
- it_should_output "<v:rect alt=\"String\"/>"
267
- end
254
+ for_attribute(:alt) do
255
+ with_value("String") do
256
+ it_should_assign_successfully
257
+ it_should_output "<v:rect alt=\"String\"/>"
258
+ end
268
259
 
269
- with_value("000001f") do
270
- it_should_assign_successfully
271
- it_should_output "<v:rect alt=\"000001f\"/>"
272
- end
260
+ with_value("000001f") do
261
+ it_should_assign_successfully
262
+ it_should_output "<v:rect alt=\"000001f\"/>"
263
+ end
273
264
 
274
265
 
275
- with_values(bad_string_values) do
276
- it_should_raise_an_exception
266
+ with_values(bad_string_values) do
267
+ it_should_raise_an_exception
268
+ end
277
269
  end
278
- end
279
270
 
280
- for_attribute(:css_class, displays_as: :class) do
281
- with_value("String") do
282
- it_should_assign_successfully
283
- it_should_output "<v:rect class=\"String\"/>"
284
- end
271
+ for_attribute(:css_class, displays_as: :class) do
272
+ with_value("String") do
273
+ it_should_assign_successfully
274
+ it_should_output "<v:rect class=\"String\"/>"
275
+ end
285
276
 
286
- with_values(bad_string_values) do
287
- it_should_raise_an_exception
277
+ with_values(bad_string_values) do
278
+ it_should_raise_an_exception
279
+ end
288
280
  end
289
- end
290
281
 
291
- for_attribute(:href) do
292
- with_value("http://something.com") do
293
- it_should_assign_successfully
294
- it_should_output "<v:rect href=\"http://something.com\"/>"
295
- end
282
+ for_attribute(:href) do
283
+ with_value("http://something.com") do
284
+ it_should_assign_successfully
285
+ it_should_output "<v:rect href=\"http://something.com\"/>"
286
+ end
296
287
 
297
- with_values(bad_string_values) do
298
- it_should_raise_an_exception
288
+ with_values(bad_string_values) do
289
+ it_should_raise_an_exception
290
+ end
299
291
  end
300
- end
301
292
 
302
- for_attribute(:id) do
303
- with_value("String") do
304
- it_should_assign_successfully
305
- it_should_output "<v:rect id=\"String\"/>"
306
- end
293
+ for_attribute(:id) do
294
+ with_value("String") do
295
+ it_should_assign_successfully
296
+ it_should_output "<v:rect id=\"String\"/>"
297
+ end
307
298
 
308
- with_values(bad_string_values) do
309
- it_should_raise_an_exception
299
+ with_values(bad_string_values) do
300
+ it_should_raise_an_exception
301
+ end
310
302
  end
311
- end
312
303
 
313
- for_attribute(:opacity) do
314
- with_value("String") do
315
- it_should_assign_successfully
316
- it_should_output "<v:rect opacity=\"String\"/>"
317
- end
304
+ for_attribute(:opacity) do
305
+ with_value("String") do
306
+ it_should_assign_successfully
307
+ it_should_output "<v:rect opacity=\"String\"/>"
308
+ end
318
309
 
319
- with_value("0.5") do
320
- it_should_assign_successfully
321
- it_should_output "<v:rect opacity=\"0.5\"/>"
322
- end
310
+ with_value("0.5") do
311
+ it_should_assign_successfully
312
+ it_should_output "<v:rect opacity=\"0.5\"/>"
313
+ end
323
314
 
324
- with_values(bad_string_values) do
325
- it_should_raise_an_exception
315
+ with_values(bad_string_values) do
316
+ it_should_raise_an_exception
317
+ end
326
318
  end
327
- end
328
319
 
329
- for_attribute(:stroke_weight, displays_as: :strokeweight) do
330
- with_value("String") do
331
- it_should_assign_successfully
332
- it_should_output "<v:rect strokeweight=\"String\"/>"
333
- end
320
+ for_attribute(:stroke_weight, displays_as: :strokeweight) do
321
+ with_value("String") do
322
+ it_should_assign_successfully
323
+ it_should_output "<v:rect strokeweight=\"String\"/>"
324
+ end
334
325
 
335
- with_value("000001f") do
336
- it_should_assign_successfully
337
- it_should_output "<v:rect strokeweight=\"000001f\"/>"
338
- end
326
+ with_value("000001f") do
327
+ it_should_assign_successfully
328
+ it_should_output "<v:rect strokeweight=\"000001f\"/>"
329
+ end
339
330
 
340
- with_values(bad_string_values) do
341
- it_should_raise_an_exception
331
+ with_values(bad_string_values) do
332
+ it_should_raise_an_exception
333
+ end
342
334
  end
343
- end
344
335
 
345
- for_attribute(:style) do
346
- with_value("String") do
347
- it_should_assign_successfully
348
- it_should_output "<v:rect style=\"String\"/>"
349
- end
336
+ for_attribute(:style) do
337
+ with_value("String") do
338
+ it_should_assign_successfully
339
+ it_should_output "<v:rect style=\"String\"/>"
340
+ end
350
341
 
351
- with_values(bad_string_values) do
352
- it_should_raise_an_exception
342
+ with_values(bad_string_values) do
343
+ it_should_raise_an_exception
344
+ end
353
345
  end
354
- end
355
346
 
356
- for_attribute(:target) do
357
- with_value("String") do
358
- it_should_assign_successfully
359
- it_should_output "<v:rect target=\"String\"/>"
360
- end
347
+ for_attribute(:target) do
348
+ with_value("String") do
349
+ it_should_assign_successfully
350
+ it_should_output "<v:rect target=\"String\"/>"
351
+ end
361
352
 
362
- with_values(bad_string_values) do
363
- it_should_raise_an_exception
353
+ with_values(bad_string_values) do
354
+ it_should_raise_an_exception
355
+ end
364
356
  end
365
- end
366
357
 
367
- for_attribute(:title) do
368
- with_value("String") do
369
- it_should_assign_successfully
370
- it_should_output "<v:rect title=\"String\"/>"
371
- end
358
+ for_attribute(:title) do
359
+ with_value("String") do
360
+ it_should_assign_successfully
361
+ it_should_output "<v:rect title=\"String\"/>"
362
+ end
372
363
 
373
- with_values(bad_string_values) do
374
- it_should_raise_an_exception
364
+ with_values(bad_string_values) do
365
+ it_should_raise_an_exception
366
+ end
375
367
  end
376
- end
377
368
 
378
- for_attribute(:wrap_coordinates, displays_as: :wrapcoords) do
379
- with_value("String") do
380
- it_should_assign_successfully
381
- it_should_output "<v:rect wrapcoords=\"String\"/>"
382
- end
369
+ for_attribute(:wrap_coordinates, displays_as: :wrapcoords) do
370
+ with_value("String") do
371
+ it_should_assign_successfully
372
+ it_should_output "<v:rect wrapcoords=\"String\"/>"
373
+ end
383
374
 
384
- with_value("0,0,100,100") do
385
- it_should_assign_successfully
386
- it_should_output "<v:rect wrapcoords=\"0,0,100,100\"/>"
387
- end
375
+ with_value("0,0,100,100") do
376
+ it_should_assign_successfully
377
+ it_should_output "<v:rect wrapcoords=\"0,0,100,100\"/>"
378
+ end
388
379
 
389
- with_values(bad_string_values) do
390
- it_should_raise_an_exception
380
+ with_values(bad_string_values) do
381
+ it_should_raise_an_exception
382
+ end
391
383
  end
392
- end
393
384
 
394
- for_attribute(:border_bottom_color, displays_as: :borderbottomcolor, with_namespace: :o) do
395
- with_value("String") do
396
- it_should_assign_successfully
397
- it_should_output "<v:rect o:borderbottomcolor=\"String\"/>"
398
- end
385
+ for_attribute(:border_bottom_color, displays_as: :borderbottomcolor, with_namespace: :o) do
386
+ with_value("String") do
387
+ it_should_assign_successfully
388
+ it_should_output "<v:rect o:borderbottomcolor=\"String\"/>"
389
+ end
399
390
 
400
- with_values(bad_string_values) do
401
- it_should_raise_an_exception
391
+ with_values(bad_string_values) do
392
+ it_should_raise_an_exception
393
+ end
402
394
  end
403
- end
404
395
 
405
- for_attribute(:border_left_color, displays_as: :borderleftcolor, with_namespace: :o) do
406
- with_value("String") do
407
- it_should_assign_successfully
408
- it_should_output "<v:rect o:borderleftcolor=\"String\"/>"
409
- end
396
+ for_attribute(:border_left_color, displays_as: :borderleftcolor, with_namespace: :o) do
397
+ with_value("String") do
398
+ it_should_assign_successfully
399
+ it_should_output "<v:rect o:borderleftcolor=\"String\"/>"
400
+ end
410
401
 
411
- with_values(bad_string_values) do
412
- it_should_raise_an_exception
402
+ with_values(bad_string_values) do
403
+ it_should_raise_an_exception
404
+ end
413
405
  end
414
- end
415
406
 
416
- for_attribute(:border_right_color, displays_as: :borderrightcolor, with_namespace: :o) do
417
- with_value("String") do
418
- it_should_assign_successfully
419
- it_should_output "<v:rect o:borderrightcolor=\"String\"/>"
420
- end
407
+ for_attribute(:border_right_color, displays_as: :borderrightcolor, with_namespace: :o) do
408
+ with_value("String") do
409
+ it_should_assign_successfully
410
+ it_should_output "<v:rect o:borderrightcolor=\"String\"/>"
411
+ end
421
412
 
422
- with_values(bad_string_values) do
423
- it_should_raise_an_exception
413
+ with_values(bad_string_values) do
414
+ it_should_raise_an_exception
415
+ end
424
416
  end
425
- end
426
417
 
427
- for_attribute(:border_top_color, displays_as: :bordertopcolor, with_namespace: :o) do
428
- with_value("String") do
429
- it_should_assign_successfully
430
- it_should_output "<v:rect o:bordertopcolor=\"String\"/>"
431
- end
418
+ for_attribute(:border_top_color, displays_as: :bordertopcolor, with_namespace: :o) do
419
+ with_value("String") do
420
+ it_should_assign_successfully
421
+ it_should_output "<v:rect o:bordertopcolor=\"String\"/>"
422
+ end
432
423
 
433
- with_values(bad_string_values) do
434
- it_should_raise_an_exception
424
+ with_values(bad_string_values) do
425
+ it_should_raise_an_exception
426
+ end
435
427
  end
436
- end
437
428
 
438
- for_attribute(:optional_string, displays_as: :spid, with_namespace: :o) do
439
- with_value("String") do
440
- it_should_assign_successfully
441
- it_should_output "<v:rect o:spid=\"String\"/>"
442
- end
429
+ for_attribute(:optional_string, displays_as: :spid, with_namespace: :o) do
430
+ with_value("String") do
431
+ it_should_assign_successfully
432
+ it_should_output "<v:rect o:spid=\"String\"/>"
433
+ end
443
434
 
444
- with_values(bad_string_values) do
445
- it_should_raise_an_exception
435
+ with_values(bad_string_values) do
436
+ it_should_raise_an_exception
437
+ end
446
438
  end
447
- end
448
439
 
449
- for_attribute(:optional_number, displays_as: :spt, with_namespace: :o) do
450
- with_value("NumberAsString") do
451
- it_should_assign_successfully
452
- it_should_output "<v:rect o:spt=\"NumberAsString\"/>"
453
- end
440
+ for_attribute(:optional_number, displays_as: :spt, with_namespace: :o) do
441
+ with_value("NumberAsString") do
442
+ it_should_assign_successfully
443
+ it_should_output "<v:rect o:spt=\"NumberAsString\"/>"
444
+ end
454
445
 
455
- with_values(bad_string_values) do
456
- it_should_raise_an_exception
446
+ with_values(bad_string_values) do
447
+ it_should_raise_an_exception
448
+ end
457
449
  end
458
450
  end
459
451
 
452
+ describe "(Explicitly) True/False-based Attributes" do
453
+ good_tf_values = [true, false]
454
+ bad_tf_values = ["yes", "no", "on", "off", 5]
460
455
 
461
- # (Explicitly) True/False-based Attributes
462
-
463
- good_tf_values = %w(0 1 t f true false)
464
- bad_tf_values = ["yes", "no", "on", "off", 5]
465
-
466
- for_attribute(:filled) do
467
- good_tf_values.each do |good_value|
468
- with_value(good_value) do
469
- it_should_assign_successfully
470
- it_should_output "<v:rect filled=\"#{good_value}\"/>"
456
+ for_attribute(:filled) do
457
+ good_tf_values.each do |good_value|
458
+ with_value(good_value) do
459
+ it_should_assign_successfully
460
+ it_should_output "<v:rect filled=\"#{good_value}\"/>"
461
+ end
471
462
  end
472
- end
473
463
 
474
- with_values(bad_tf_values) do
475
- it_should_raise_an_exception
464
+ with_values(bad_tf_values) do
465
+ it_should_raise_an_exception
466
+ end
476
467
  end
477
- end
478
468
 
479
- for_attribute(:inset_pen, displays_as: :insetpen) do
480
- good_tf_values.each do |good_value|
481
- with_value(good_value) do
482
- it_should_assign_successfully
483
- it_should_output "<v:rect insetpen=\"#{good_value}\"/>"
469
+ for_attribute(:inset_pen, displays_as: :insetpen) do
470
+ good_tf_values.each do |good_value|
471
+ with_value(good_value) do
472
+ it_should_assign_successfully
473
+ it_should_output "<v:rect insetpen=\"#{good_value}\"/>"
474
+ end
484
475
  end
485
- end
486
476
 
487
- with_values(bad_tf_values) do
488
- it_should_raise_an_exception
477
+ with_values(bad_tf_values) do
478
+ it_should_raise_an_exception
479
+ end
489
480
  end
490
- end
491
481
 
492
- for_attribute(:print) do
493
- good_tf_values.each do |good_value|
494
- with_value(good_value) do
495
- it_should_assign_successfully
496
- it_should_output "<v:rect print=\"#{good_value}\"/>"
482
+ for_attribute(:print) do
483
+ good_tf_values.each do |good_value|
484
+ with_value(good_value) do
485
+ it_should_assign_successfully
486
+ it_should_output "<v:rect print=\"#{good_value}\"/>"
487
+ end
497
488
  end
498
- end
499
489
 
500
- with_values(bad_tf_values) do
501
- it_should_raise_an_exception
490
+ with_values(bad_tf_values) do
491
+ it_should_raise_an_exception
492
+ end
502
493
  end
503
- end
504
494
 
505
- for_attribute(:stroked) do
506
- good_tf_values.each do |good_value|
507
- with_value(good_value) do
508
- it_should_assign_successfully
509
- it_should_output "<v:rect stroked=\"#{good_value}\"/>"
495
+ for_attribute(:stroked) do
496
+ good_tf_values.each do |good_value|
497
+ with_value(good_value) do
498
+ it_should_assign_successfully
499
+ it_should_output "<v:rect stroked=\"#{good_value}\"/>"
500
+ end
510
501
  end
511
- end
512
502
 
513
- with_values(bad_tf_values) do
514
- it_should_raise_an_exception
503
+ with_values(bad_tf_values) do
504
+ it_should_raise_an_exception
505
+ end
515
506
  end
516
- end
517
507
 
518
- for_attribute(:allow_in_cell, displays_as: :allowincell, with_namespace: :o) do
519
- good_tf_values.each do |good_value|
520
- with_value(good_value) do
521
- it_should_assign_successfully
522
- it_should_output "<v:rect o:allowincell=\"#{good_value}\"/>"
508
+ for_attribute(:allow_in_cell, displays_as: :allowincell, with_namespace: :o) do
509
+ good_tf_values.each do |good_value|
510
+ with_value(good_value) do
511
+ it_should_assign_successfully
512
+ it_should_output "<v:rect o:allowincell=\"#{good_value}\"/>"
513
+ end
514
+ end
515
+ with_values(bad_tf_values) do
516
+ it_should_raise_an_exception
523
517
  end
524
518
  end
525
- with_values(bad_tf_values) do
526
- it_should_raise_an_exception
527
- end
528
- end
529
519
 
530
- for_attribute(:allow_overlap, displays_as: :allowoverlap, with_namespace: :o) do
531
- good_tf_values.each do |good_value|
532
- with_value(good_value) do
533
- it_should_assign_successfully
534
- it_should_output "<v:rect o:allowoverlap=\"#{good_value}\"/>"
520
+ for_attribute(:allow_overlap, displays_as: :allowoverlap, 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:rect o:allowoverlap=\"#{good_value}\"/>"
525
+ end
535
526
  end
536
- end
537
527
 
538
- with_values(bad_tf_values) do
539
- it_should_raise_an_exception
528
+ with_values(bad_tf_values) do
529
+ it_should_raise_an_exception
530
+ end
540
531
  end
541
- end
542
532
 
543
- for_attribute(:bullet, with_namespace: :o) do
544
- good_tf_values.each do |good_value|
545
- with_value(good_value) do
546
- it_should_assign_successfully
547
- it_should_output "<v:rect o:bullet=\"#{good_value}\"/>"
533
+ for_attribute(:bullet, with_namespace: :o) do
534
+ good_tf_values.each do |good_value|
535
+ with_value(good_value) do
536
+ it_should_assign_successfully
537
+ it_should_output "<v:rect o:bullet=\"#{good_value}\"/>"
538
+ end
548
539
  end
549
- end
550
540
 
551
- with_values(bad_tf_values) do
552
- it_should_raise_an_exception
541
+ with_values(bad_tf_values) do
542
+ it_should_raise_an_exception
543
+ end
553
544
  end
554
- end
555
545
 
556
- for_attribute(:button, with_namespace: :o) do
557
- good_tf_values.each do |good_value|
558
- with_value(good_value) do
559
- it_should_assign_successfully
560
- it_should_output "<v:rect o:button=\"#{good_value}\"/>"
546
+ for_attribute(:button, with_namespace: :o) do
547
+ good_tf_values.each do |good_value|
548
+ with_value(good_value) do
549
+ it_should_assign_successfully
550
+ it_should_output "<v:rect o:button=\"#{good_value}\"/>"
551
+ end
561
552
  end
562
- end
563
553
 
564
- with_values(bad_tf_values) do
565
- it_should_raise_an_exception
554
+ with_values(bad_tf_values) do
555
+ it_should_raise_an_exception
556
+ end
566
557
  end
567
- end
568
558
 
569
- for_attribute(:clip, with_namespace: :o) do
570
- good_tf_values.each do |good_value|
571
- with_value(good_value) do
572
- it_should_assign_successfully
573
- it_should_output "<v:rect o:clip=\"#{good_value}\"/>"
559
+ for_attribute(:clip, with_namespace: :o) do
560
+ good_tf_values.each do |good_value|
561
+ with_value(good_value) do
562
+ it_should_assign_successfully
563
+ it_should_output "<v:rect o:clip=\"#{good_value}\"/>"
564
+ end
574
565
  end
575
- end
576
566
 
577
- with_values(bad_tf_values) do
578
- it_should_raise_an_exception
567
+ with_values(bad_tf_values) do
568
+ it_should_raise_an_exception
569
+ end
579
570
  end
580
- end
581
571
 
582
- for_attribute(:clip_to_wrap, displays_as: :cliptowrap, with_namespace: :o) do
583
- good_tf_values.each do |good_value|
584
- with_value(good_value) do
585
- it_should_assign_successfully
586
- it_should_output "<v:rect o:cliptowrap=\"#{good_value}\"/>"
572
+ for_attribute(:clip_to_wrap, displays_as: :cliptowrap, with_namespace: :o) do
573
+ good_tf_values.each do |good_value|
574
+ with_value(good_value) do
575
+ it_should_assign_successfully
576
+ it_should_output "<v:rect o:cliptowrap=\"#{good_value}\"/>"
577
+ end
587
578
  end
588
- end
589
579
 
590
- with_values(bad_tf_values) do
591
- it_should_raise_an_exception
580
+ with_values(bad_tf_values) do
581
+ it_should_raise_an_exception
582
+ end
592
583
  end
593
- end
594
584
 
595
- for_attribute(:double_click_notify, displays_as: :doubleclicknotify, with_namespace: :o) do
596
- good_tf_values.each do |good_value|
597
- with_value(good_value) do
598
- it_should_assign_successfully
599
- it_should_output "<v:rect o:doubleclicknotify=\"#{good_value}\"/>"
585
+ for_attribute(:double_click_notify, displays_as: :doubleclicknotify, with_namespace: :o) do
586
+ good_tf_values.each do |good_value|
587
+ with_value(good_value) do
588
+ it_should_assign_successfully
589
+ it_should_output "<v:rect o:doubleclicknotify=\"#{good_value}\"/>"
590
+ end
600
591
  end
601
- end
602
592
 
603
- with_values(bad_tf_values) do
604
- it_should_raise_an_exception
593
+ with_values(bad_tf_values) do
594
+ it_should_raise_an_exception
595
+ end
605
596
  end
606
- end
607
597
 
608
- for_attribute(:force_dash, displays_as: :forcedash, with_namespace: :o) do
609
- good_tf_values.each do |good_value|
610
- with_value(good_value) do
611
- it_should_assign_successfully
612
- it_should_output "<v:rect o:forcedash=\"#{good_value}\"/>"
598
+ for_attribute(:force_dash, displays_as: :forcedash, with_namespace: :o) do
599
+ good_tf_values.each do |good_value|
600
+ with_value(good_value) do
601
+ it_should_assign_successfully
602
+ it_should_output "<v:rect o:forcedash=\"#{good_value}\"/>"
603
+ end
613
604
  end
614
- end
615
605
 
616
- with_values(bad_tf_values) do
617
- it_should_raise_an_exception
606
+ with_values(bad_tf_values) do
607
+ it_should_raise_an_exception
608
+ end
618
609
  end
619
- end
620
610
 
621
- for_attribute(:hr, with_namespace: :o) do
622
- good_tf_values.each do |good_value|
623
- with_value(good_value) do
624
- it_should_assign_successfully
625
- it_should_output "<v:rect o:hr=\"#{good_value}\"/>"
611
+ for_attribute(:hr, with_namespace: :o) do
612
+ good_tf_values.each do |good_value|
613
+ with_value(good_value) do
614
+ it_should_assign_successfully
615
+ it_should_output "<v:rect o:hr=\"#{good_value}\"/>"
616
+ end
626
617
  end
627
- end
628
618
 
629
- with_values(bad_tf_values) do
630
- it_should_raise_an_exception
619
+ with_values(bad_tf_values) do
620
+ it_should_raise_an_exception
621
+ end
631
622
  end
632
- end
633
623
 
634
- for_attribute(:hr_no_shade, displays_as: :hrnoshade, with_namespace: :o) do
635
- good_tf_values.each do |good_value|
636
- with_value(good_value) do
637
- it_should_assign_successfully
638
- it_should_output "<v:rect o:hrnoshade=\"#{good_value}\"/>"
624
+ for_attribute(:hr_no_shade, displays_as: :hrnoshade, with_namespace: :o) do
625
+ good_tf_values.each do |good_value|
626
+ with_value(good_value) do
627
+ it_should_assign_successfully
628
+ it_should_output "<v:rect o:hrnoshade=\"#{good_value}\"/>"
629
+ end
639
630
  end
640
- end
641
631
 
642
- with_values(bad_tf_values) do
643
- it_should_raise_an_exception
632
+ with_values(bad_tf_values) do
633
+ it_should_raise_an_exception
634
+ end
644
635
  end
645
- end
646
636
 
647
- for_attribute(:hr_standard, displays_as: :hrstd, with_namespace: :o) do
648
- good_tf_values.each do |good_value|
649
- with_value(good_value) do
650
- it_should_assign_successfully
651
- it_should_output "<v:rect o:hrstd=\"#{good_value}\"/>"
637
+ for_attribute(:hr_standard, displays_as: :hrstd, with_namespace: :o) do
638
+ good_tf_values.each do |good_value|
639
+ with_value(good_value) do
640
+ it_should_assign_successfully
641
+ it_should_output "<v:rect o:hrstd=\"#{good_value}\"/>"
642
+ end
652
643
  end
653
- end
654
644
 
655
- with_values(bad_tf_values) do
656
- it_should_raise_an_exception
645
+ with_values(bad_tf_values) do
646
+ it_should_raise_an_exception
647
+ end
657
648
  end
658
- end
659
649
 
660
- for_attribute(:ole, with_namespace: :o) do
661
- good_tf_values.each do |good_value|
662
- with_value(good_value) do
663
- it_should_assign_successfully
664
- it_should_output "<v:rect o:ole=\"#{good_value}\"/>"
650
+ for_attribute(:ole, with_namespace: :o) do
651
+ good_tf_values.each do |good_value|
652
+ with_value(good_value) do
653
+ it_should_assign_successfully
654
+ it_should_output "<v:rect o:ole=\"#{good_value}\"/>"
655
+ end
665
656
  end
666
- end
667
657
 
668
- with_values(bad_tf_values) do
669
- it_should_raise_an_exception
658
+ with_values(bad_tf_values) do
659
+ it_should_raise_an_exception
660
+ end
670
661
  end
671
- end
672
662
 
673
- for_attribute(:ole_icon, displays_as: :oleicon, with_namespace: :o) do
674
- good_tf_values.each do |good_value|
675
- with_value(good_value) do
676
- it_should_assign_successfully
677
- it_should_output "<v:rect o:oleicon=\"#{good_value}\"/>"
663
+ for_attribute(:ole_icon, displays_as: :oleicon, with_namespace: :o) do
664
+ good_tf_values.each do |good_value|
665
+ with_value(good_value) do
666
+ it_should_assign_successfully
667
+ it_should_output "<v:rect o:oleicon=\"#{good_value}\"/>"
668
+ end
678
669
  end
679
- end
680
670
 
681
- with_values(bad_tf_values) do
682
- it_should_raise_an_exception
671
+ with_values(bad_tf_values) do
672
+ it_should_raise_an_exception
673
+ end
683
674
  end
684
- end
685
675
 
686
- for_attribute(:hide_extra_handles, displays_as: :oned, with_namespace: :o) do
687
- good_tf_values.each do |good_value|
688
- with_value(good_value) do
689
- it_should_assign_successfully
690
- it_should_output "<v:rect o:oned=\"#{good_value}\"/>"
676
+ for_attribute(:hide_extra_handles, displays_as: :oned, with_namespace: :o) do
677
+ good_tf_values.each do |good_value|
678
+ with_value(good_value) do
679
+ it_should_assign_successfully
680
+ it_should_output "<v:rect o:oned=\"#{good_value}\"/>"
681
+ end
691
682
  end
692
- end
693
683
 
694
- with_values(bad_tf_values) do
695
- it_should_raise_an_exception
684
+ with_values(bad_tf_values) do
685
+ it_should_raise_an_exception
686
+ end
696
687
  end
697
- end
698
688
 
699
- for_attribute(:prefer_relative, displays_as: :preferrelative, with_namespace: :o) do
700
- good_tf_values.each do |good_value|
701
- with_value(good_value) do
702
- it_should_assign_successfully
703
- it_should_output "<v:rect o:preferrelative=\"#{good_value}\"/>"
689
+ for_attribute(:prefer_relative, displays_as: :preferrelative, with_namespace: :o) do
690
+ good_tf_values.each do |good_value|
691
+ with_value(good_value) do
692
+ it_should_assign_successfully
693
+ it_should_output "<v:rect o:preferrelative=\"#{good_value}\"/>"
694
+ end
704
695
  end
705
- end
706
696
 
707
- with_values(bad_tf_values) do
708
- it_should_raise_an_exception
697
+ with_values(bad_tf_values) do
698
+ it_should_raise_an_exception
699
+ end
709
700
  end
710
- end
711
701
 
712
- for_attribute(:user_drawn, displays_as: :userdrawn, with_namespace: :o) do
713
- good_tf_values.each do |good_value|
714
- with_value(good_value) do
715
- it_should_assign_successfully
716
- it_should_output "<v:rect o:userdrawn=\"#{good_value}\"/>"
702
+ for_attribute(:user_drawn, displays_as: :userdrawn, with_namespace: :o) do
703
+ good_tf_values.each do |good_value|
704
+ with_value(good_value) do
705
+ it_should_assign_successfully
706
+ it_should_output "<v:rect o:userdrawn=\"#{good_value}\"/>"
707
+ end
717
708
  end
718
- end
719
709
 
720
- with_values(bad_tf_values) do
721
- it_should_raise_an_exception
710
+ with_values(bad_tf_values) do
711
+ it_should_raise_an_exception
712
+ end
722
713
  end
723
- end
724
714
 
725
- for_attribute(:user_hidden, displays_as: :userhidden, with_namespace: :o) do
726
- good_tf_values.each do |good_value|
727
- with_value(good_value) do
728
- it_should_assign_successfully
729
- it_should_output "<v:rect o:userhidden=\"#{good_value}\"/>"
715
+ for_attribute(:user_hidden, displays_as: :userhidden, with_namespace: :o) do
716
+ good_tf_values.each do |good_value|
717
+ with_value(good_value) do
718
+ it_should_assign_successfully
719
+ it_should_output "<v:rect o:userhidden=\"#{good_value}\"/>"
720
+ end
730
721
  end
731
- end
732
722
 
733
- with_values(bad_tf_values) do
734
- it_should_raise_an_exception
723
+ with_values(bad_tf_values) do
724
+ it_should_raise_an_exception
725
+ end
735
726
  end
736
727
  end
737
728
 
738
-
739
729
  end