openxml-docx 0.10.6 → 0.11.0.rc

Sign up to get free protection for your applications and to get access to all the features.
Files changed (451) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -2
  3. data/Gemfile +7 -1
  4. data/Gemfile.lock +33 -30
  5. data/README.md +34 -8
  6. data/bin/console +14 -0
  7. data/bin/setup +8 -0
  8. data/lib/openxml/docx.rb +5 -2
  9. data/lib/openxml/docx/element.rb +9 -0
  10. data/lib/openxml/docx/elements.rb +2 -2
  11. data/lib/openxml/docx/elements/absolute_position_tab.rb +1 -1
  12. data/lib/openxml/docx/elements/background.rb +3 -2
  13. data/lib/openxml/docx/elements/bidi_embed.rb +3 -1
  14. data/lib/openxml/docx/elements/bidi_override.rb +3 -1
  15. data/lib/openxml/docx/elements/book_fold_printing.rb +1 -1
  16. data/lib/openxml/docx/elements/book_fold_printing_sheets.rb +1 -1
  17. data/lib/openxml/docx/elements/book_fold_reverse_printing.rb +1 -1
  18. data/lib/openxml/docx/elements/break.rb +1 -1
  19. data/lib/openxml/docx/elements/carriage_return.rb +1 -1
  20. data/lib/openxml/docx/elements/compatibility_setting.rb +3 -1
  21. data/lib/openxml/docx/elements/compatibility_settings.rb +3 -1
  22. data/lib/openxml/docx/elements/content_part.rb +1 -1
  23. data/lib/openxml/docx/elements/control.rb +1 -1
  24. data/lib/openxml/docx/elements/dirty.rb +1 -1
  25. data/lib/openxml/docx/elements/drawing.rb +4 -1
  26. data/lib/openxml/docx/elements/embed_bold.rb +1 -1
  27. data/lib/openxml/docx/elements/embed_bold_italic.rb +1 -1
  28. data/lib/openxml/docx/elements/embed_italic.rb +1 -1
  29. data/lib/openxml/docx/elements/embed_regular.rb +1 -1
  30. data/lib/openxml/docx/elements/embed_system_fonts.rb +1 -1
  31. data/lib/openxml/docx/elements/embed_true_type_fonts.rb +1 -1
  32. data/lib/openxml/docx/elements/even_and_odd_headers.rb +1 -1
  33. data/lib/openxml/docx/elements/family.rb +1 -1
  34. data/lib/openxml/docx/elements/font.rb +3 -1
  35. data/lib/openxml/docx/elements/font_alternate_name.rb +1 -1
  36. data/lib/openxml/docx/elements/font_character_set.rb +1 -1
  37. data/lib/openxml/docx/elements/font_panose_one.rb +1 -1
  38. data/lib/openxml/docx/elements/font_pitch.rb +1 -1
  39. data/lib/openxml/docx/elements/font_sig.rb +1 -1
  40. data/lib/openxml/docx/elements/grid_column.rb +1 -1
  41. data/lib/openxml/docx/elements/group_shape.rb +3 -1
  42. data/lib/openxml/docx/elements/last_rendered_page_break.rb +1 -1
  43. data/lib/openxml/docx/elements/long_day.rb +1 -1
  44. data/lib/openxml/docx/elements/long_month.rb +1 -1
  45. data/lib/openxml/docx/elements/long_year.rb +1 -1
  46. data/lib/openxml/docx/elements/markup_compatibility_alternate_content.rb +4 -1
  47. data/lib/openxml/docx/elements/markup_compatibility_choice.rb +3 -1
  48. data/lib/openxml/docx/elements/markup_compatibility_fallback.rb +4 -1
  49. data/lib/openxml/docx/elements/nonbreaking_hyphen.rb +1 -1
  50. data/lib/openxml/docx/elements/optional_hyphen.rb +1 -1
  51. data/lib/openxml/docx/elements/page_number.rb +1 -1
  52. data/lib/openxml/docx/elements/paragraph.rb +3 -1
  53. data/lib/openxml/docx/elements/ruby.rb +2 -1
  54. data/lib/openxml/docx/elements/run.rb +3 -1
  55. data/lib/openxml/docx/elements/save_subset_fonts.rb +1 -1
  56. data/lib/openxml/docx/elements/section_properties.rb +4 -1
  57. data/lib/openxml/docx/elements/short_day.rb +1 -1
  58. data/lib/openxml/docx/elements/short_month.rb +1 -1
  59. data/lib/openxml/docx/elements/short_year.rb +1 -1
  60. data/lib/openxml/docx/elements/symbol.rb +1 -1
  61. data/lib/openxml/docx/elements/tab.rb +1 -1
  62. data/lib/openxml/docx/elements/table.rb +3 -1
  63. data/lib/openxml/docx/elements/table_cell.rb +3 -1
  64. data/lib/openxml/docx/elements/table_grid.rb +3 -1
  65. data/lib/openxml/docx/elements/table_row.rb +3 -1
  66. data/lib/openxml/docx/elements/text.rb +1 -1
  67. data/lib/openxml/docx/elements/textbox_content.rb +4 -1
  68. data/lib/openxml/docx/elements/title_page.rb +1 -1
  69. data/lib/openxml/docx/elements/vml_container.rb +3 -1
  70. data/lib/openxml/docx/elements/word_processing_drawing_anchor.rb +3 -1
  71. data/lib/openxml/docx/elements/word_processing_drawing_effect_extent.rb +1 -1
  72. data/lib/openxml/docx/elements/word_processing_drawing_extent.rb +1 -1
  73. data/lib/openxml/docx/elements/word_processing_drawing_inline.rb +3 -1
  74. data/lib/openxml/docx/elements/word_processing_drawing_nv_graphic_frame_properties.rb +3 -1
  75. data/lib/openxml/docx/elements/word_processing_drawing_object_nv_properties.rb +1 -1
  76. data/lib/openxml/docx/elements/word_processing_drawing_position_h.rb +3 -1
  77. data/lib/openxml/docx/elements/word_processing_drawing_position_offset.rb +1 -1
  78. data/lib/openxml/docx/elements/word_processing_drawing_position_v.rb +3 -1
  79. data/lib/openxml/docx/elements/word_processing_drawing_simple_position.rb +1 -1
  80. data/lib/openxml/docx/elements/word_processing_drawing_wrap_coordinate.rb +1 -1
  81. data/lib/openxml/docx/elements/word_processing_drawing_wrap_none.rb +1 -1
  82. data/lib/openxml/docx/elements/word_processing_drawing_wrap_polygon.rb +3 -1
  83. data/lib/openxml/docx/elements/word_processing_drawing_wrap_square.rb +1 -1
  84. data/lib/openxml/docx/elements/word_processing_drawing_wrap_through.rb +3 -1
  85. data/lib/openxml/docx/elements/word_processing_drawing_wrap_tight.rb +3 -1
  86. data/lib/openxml/docx/elements/word_processing_drawing_wrap_top_and_bottom.rb +1 -1
  87. data/lib/openxml/docx/elements/word_processing_groups_group_shape_properties.rb +3 -1
  88. data/lib/openxml/docx/elements/word_processing_groups_nv_shape_drawing_properties.rb +3 -1
  89. data/lib/openxml/docx/elements/word_processing_shapes_body_properties.rb +3 -1
  90. data/lib/openxml/docx/elements/word_processing_shapes_nv_drawing_properties.rb +3 -1
  91. data/lib/openxml/docx/elements/word_processing_shapes_shape.rb +4 -1
  92. data/lib/openxml/docx/elements/word_processing_shapes_shape_properties.rb +3 -1
  93. data/lib/openxml/docx/elements/word_processing_shapes_textual_contents.rb +3 -1
  94. data/lib/openxml/docx/elements/wordprocessing_shape_group.rb +3 -1
  95. data/lib/openxml/docx/{property_builder.rb → has_properties.rb} +13 -2
  96. data/lib/openxml/docx/properties/border.rb +2 -2
  97. data/lib/openxml/docx/properties/color.rb +1 -1
  98. data/lib/openxml/docx/properties/complex_property.rb +3 -1
  99. data/lib/openxml/docx/properties/container_property.rb +3 -1
  100. data/lib/openxml/docx/properties/shading.rb +2 -2
  101. data/lib/openxml/docx/properties/table_border.rb +2 -2
  102. data/lib/openxml/docx/properties/table_cell_border.rb +2 -2
  103. data/lib/openxml/docx/properties/underline.rb +1 -1
  104. data/lib/openxml/docx/section.rb +1 -1
  105. data/lib/openxml/docx/style.rb +3 -2
  106. data/lib/openxml/docx/version.rb +1 -1
  107. data/lib/openxml/vml.rb +1 -2
  108. data/lib/openxml/vml/elements.rb +2 -2
  109. data/lib/openxml/vml/elements/group.rb +3 -1
  110. data/lib/openxml/vml/elements/rectangle.rb +3 -1
  111. data/lib/openxml/vml/elements/rounded_rectangle.rb +3 -1
  112. data/openxml-docx.gemspec +29 -22
  113. metadata +47 -347
  114. data/lib/openxml/docx/attribute_builder.rb +0 -327
  115. data/lib/openxml/docx/elements/container.rb +0 -37
  116. data/lib/openxml/docx/elements/element.rb +0 -65
  117. data/lib/openxml/drawingml.rb +0 -17
  118. data/lib/openxml/drawingml/elements.rb +0 -13
  119. data/lib/openxml/drawingml/elements/adjust_values_list.rb +0 -11
  120. data/lib/openxml/drawingml/elements/blip.rb +0 -18
  121. data/lib/openxml/drawingml/elements/blip_fill.rb +0 -14
  122. data/lib/openxml/drawingml/elements/children_extents.rb +0 -14
  123. data/lib/openxml/drawingml/elements/children_offset.rb +0 -14
  124. data/lib/openxml/drawingml/elements/extension.rb +0 -13
  125. data/lib/openxml/drawingml/elements/extension_list.rb +0 -11
  126. data/lib/openxml/drawingml/elements/extents.rb +0 -14
  127. data/lib/openxml/drawingml/elements/fill_rectangle.rb +0 -16
  128. data/lib/openxml/drawingml/elements/graphic.rb +0 -10
  129. data/lib/openxml/drawingml/elements/graphic_data.rb +0 -12
  130. data/lib/openxml/drawingml/elements/graphic_frame_locks.rb +0 -17
  131. data/lib/openxml/drawingml/elements/head_end.rb +0 -28
  132. data/lib/openxml/drawingml/elements/no_autofit.rb +0 -10
  133. data/lib/openxml/drawingml/elements/no_fill.rb +0 -10
  134. data/lib/openxml/drawingml/elements/non_visual_drawing_properties.rb +0 -17
  135. data/lib/openxml/drawingml/elements/non_visual_picture_drawing_properties.rb +0 -12
  136. data/lib/openxml/drawingml/elements/non_visual_picture_properties.rb +0 -10
  137. data/lib/openxml/drawingml/elements/non_visual_shape_drawing_properties.rb +0 -12
  138. data/lib/openxml/drawingml/elements/offset.rb +0 -14
  139. data/lib/openxml/drawingml/elements/outline.rb +0 -36
  140. data/lib/openxml/drawingml/elements/picture.rb +0 -10
  141. data/lib/openxml/drawingml/elements/picture_locks.rb +0 -23
  142. data/lib/openxml/drawingml/elements/picture_shape_properties.rb +0 -13
  143. data/lib/openxml/drawingml/elements/preset_geometry.rb +0 -210
  144. data/lib/openxml/drawingml/elements/preset_text_warp.rb +0 -25
  145. data/lib/openxml/drawingml/elements/round.rb +0 -10
  146. data/lib/openxml/drawingml/elements/shape_guide.rb +0 -40
  147. data/lib/openxml/drawingml/elements/solid_fill.rb +0 -10
  148. data/lib/openxml/drawingml/elements/source_rectangle.rb +0 -16
  149. data/lib/openxml/drawingml/elements/srgb_color.rb +0 -14
  150. data/lib/openxml/drawingml/elements/stretch.rb +0 -10
  151. data/lib/openxml/drawingml/elements/tail_end.rb +0 -28
  152. data/lib/openxml/drawingml/elements/transform_effect.rb +0 -18
  153. data/spec/elements/absolute_position_tab_spec.rb +0 -58
  154. data/spec/elements/background_spec.rb +0 -52
  155. data/spec/elements/bidi_embed_spec.rb +0 -35
  156. data/spec/elements/bidi_override_spec.rb +0 -35
  157. data/spec/elements/book_fold_printing_sheets_spec.rb +0 -27
  158. data/spec/elements/book_fold_printing_spec.rb +0 -19
  159. data/spec/elements/book_fold_reverse_printing_spec.rb +0 -19
  160. data/spec/elements/break_spec.rb +0 -34
  161. data/spec/elements/carriage_return_spec.rb +0 -12
  162. data/spec/elements/compatibility_setting_spec.rb +0 -41
  163. data/spec/elements/compatibility_settings_spec.rb +0 -8
  164. data/spec/elements/content_part_spec.rb +0 -18
  165. data/spec/elements/control_spec.rb +0 -41
  166. data/spec/elements/deleted_text_spec.rb +0 -24
  167. data/spec/elements/dirty_spec.rb +0 -12
  168. data/spec/elements/drawing_spec.rb +0 -11
  169. data/spec/elements/drawingml/adjust_values_list_spec.rb +0 -8
  170. data/spec/elements/drawingml/blip_fill_spec.rb +0 -44
  171. data/spec/elements/drawingml/blip_spec.rb +0 -47
  172. data/spec/elements/drawingml/extension_list_spec.rb +0 -8
  173. data/spec/elements/drawingml/extension_spec.rb +0 -19
  174. data/spec/elements/drawingml/extents_spec.rb +0 -33
  175. data/spec/elements/drawingml/fill_rectangle_spec.rb +0 -76
  176. data/spec/elements/drawingml/graphic_data_spec.rb +0 -19
  177. data/spec/elements/drawingml/graphic_frame_locks_spec.rb +0 -107
  178. data/spec/elements/drawingml/graphic_spec.rb +0 -8
  179. data/spec/elements/drawingml/head_end_spec.rb +0 -48
  180. data/spec/elements/drawingml/no_autofit_spec.rb +0 -8
  181. data/spec/elements/drawingml/no_fill_spec.rb +0 -8
  182. data/spec/elements/drawingml/non_visual_drawing_properties_spec.rb +0 -68
  183. data/spec/elements/drawingml/non_visual_picture_drawing_properties_spec.rb +0 -23
  184. data/spec/elements/drawingml/non_visual_picture_properties_spec.rb +0 -8
  185. data/spec/elements/drawingml/non_visual_shape_drawing_properties_spec.rb +0 -24
  186. data/spec/elements/drawingml/offset_spec.rb +0 -42
  187. data/spec/elements/drawingml/outline_spec.rb +0 -64
  188. data/spec/elements/drawingml/picture_locks_spec.rb +0 -122
  189. data/spec/elements/drawingml/picture_shape_properties_spec.rb +0 -21
  190. data/spec/elements/drawingml/picture_spec.rb +0 -8
  191. data/spec/elements/drawingml/preset_geometry_spec.rb +0 -19
  192. data/spec/elements/drawingml/preset_text_warp_spec.rb +0 -36
  193. data/spec/elements/drawingml/round_spec.rb +0 -8
  194. data/spec/elements/drawingml/shape_guide_spec.rb +0 -53
  195. data/spec/elements/drawingml/solid_fill_spec.rb +0 -8
  196. data/spec/elements/drawingml/source_rectangle_spec.rb +0 -76
  197. data/spec/elements/drawingml/srgb_color_spec.rb +0 -19
  198. data/spec/elements/drawingml/stretch_spec.rb +0 -8
  199. data/spec/elements/drawingml/tail_end_spec.rb +0 -47
  200. data/spec/elements/drawingml/transform_effect_spec.rb +0 -102
  201. data/spec/elements/embed_system_fonts_spec.rb +0 -19
  202. data/spec/elements/embed_true_type_fonts_spec.rb +0 -19
  203. data/spec/elements/even_and_odd_headers_spec.rb +0 -23
  204. data/spec/elements/font_alternate_name_spec.rb +0 -19
  205. data/spec/elements/font_character_set_spec.rb +0 -19
  206. data/spec/elements/font_panose_one_spec.rb +0 -19
  207. data/spec/elements/font_pitch_spec.rb +0 -21
  208. data/spec/elements/font_sig_spec.rb +0 -74
  209. data/spec/elements/grid_column_spec.rb +0 -15
  210. data/spec/elements/group_shape_spec.rb +0 -11
  211. data/spec/elements/last_rendered_page_break_spec.rb +0 -12
  212. data/spec/elements/long_day_spec.rb +0 -12
  213. data/spec/elements/long_month_spec.rb +0 -12
  214. data/spec/elements/long_year_spec.rb +0 -12
  215. data/spec/elements/markup_compatibility_alternate_content_spec.rb +0 -11
  216. data/spec/elements/markup_compatibility_choice_spec.rb +0 -22
  217. data/spec/elements/markup_compatibility_fallback_spec.rb +0 -11
  218. data/spec/elements/nonbreaking_hyphen_spec.rb +0 -12
  219. data/spec/elements/optional_hyphen_spec.rb +0 -12
  220. data/spec/elements/page_number_spec.rb +0 -12
  221. data/spec/elements/paragraph_spec.rb +0 -60
  222. data/spec/elements/ruby_spec.rb +0 -66
  223. data/spec/elements/run_spec.rb +0 -15
  224. data/spec/elements/save_subset_fonts_spec.rb +0 -19
  225. data/spec/elements/section_properties_spec.rb +0 -12
  226. data/spec/elements/short_day_spec.rb +0 -12
  227. data/spec/elements/short_month_spec.rb +0 -12
  228. data/spec/elements/short_year_spec.rb +0 -12
  229. data/spec/elements/symbol_spec.rb +0 -31
  230. data/spec/elements/tab_spec.rb +0 -12
  231. data/spec/elements/table_cell_spec.rb +0 -15
  232. data/spec/elements/table_grid_spec.rb +0 -17
  233. data/spec/elements/table_row_spec.rb +0 -18
  234. data/spec/elements/table_spec.rb +0 -21
  235. data/spec/elements/text_spec.rb +0 -24
  236. data/spec/elements/textbox_content_spec.rb +0 -8
  237. data/spec/elements/title_page_spec.rb +0 -23
  238. data/spec/elements/vml/group_spec.rb +0 -534
  239. data/spec/elements/vml/rectangle_spec.rb +0 -729
  240. data/spec/elements/vml/rounded_rectangle_spec.rb +0 -784
  241. data/spec/elements/vml_container_spec.rb +0 -11
  242. data/spec/elements/word_processing_drawing_anchor_spec.rb +0 -122
  243. data/spec/elements/word_processing_drawing_effect_extent_spec.rb +0 -77
  244. data/spec/elements/word_processing_drawing_extent_spec.rb +0 -34
  245. data/spec/elements/word_processing_drawing_nv_graphic_frame_properties_spec.rb +0 -11
  246. data/spec/elements/word_processing_drawing_object_nv_properties_spec.rb +0 -67
  247. data/spec/elements/word_processing_drawing_position_h_spec.rb +0 -22
  248. data/spec/elements/word_processing_drawing_position_v_spec.rb +0 -22
  249. data/spec/elements/word_processing_drawing_simple_position_spec.rb +0 -44
  250. data/spec/elements/word_processing_drawing_wrap_coordinate_spec.rb +0 -40
  251. data/spec/elements/word_processing_drawing_wrap_none_spec.rb +0 -12
  252. data/spec/elements/word_processing_drawing_wrap_polygon_spec.rb +0 -23
  253. data/spec/elements/word_processing_drawing_wrap_square_spec.rb +0 -65
  254. data/spec/elements/word_processing_drawing_wrap_through_spec.rb +0 -43
  255. data/spec/elements/word_processing_drawing_wrap_tight_spec.rb +0 -43
  256. data/spec/elements/word_processing_drawing_wrap_top_and_bottom_spec.rb +0 -30
  257. data/spec/elements/word_processing_groups_group_shape_properties_spec.rb +0 -21
  258. data/spec/elements/word_processing_groups_nv_shape_drawing_properties_spec.rb +0 -8
  259. data/spec/elements/word_processing_shapes_body_properties_spec.rb +0 -232
  260. data/spec/elements/word_processing_shapes_nv_drawing_properties_spec.rb +0 -64
  261. data/spec/elements/word_processing_shapes_shape_properties_spec.rb +0 -22
  262. data/spec/elements/word_processing_shapes_shape_spec.rb +0 -23
  263. data/spec/elements/word_processing_shapes_textual_content_spec.rb +0 -23
  264. data/spec/elements/wordprocessing_shape_group_spec.rb +0 -12
  265. data/spec/package_spec.rb +0 -36
  266. data/spec/parts/document_spec.rb +0 -95
  267. data/spec/parts/footer_spec.rb +0 -33
  268. data/spec/parts/header_spec.rb +0 -33
  269. data/spec/parts/settings_spec.rb +0 -19
  270. data/spec/parts/styles_spec.rb +0 -27
  271. data/spec/properties/alignment_spec.rb +0 -58
  272. data/spec/properties/auto_adjust_right_indent_spec.rb +0 -23
  273. data/spec/properties/auto_space_de_spec.rb +0 -23
  274. data/spec/properties/auto_space_dn_spec.rb +0 -23
  275. data/spec/properties/bidi_spec.rb +0 -22
  276. data/spec/properties/bold_spec.rb +0 -22
  277. data/spec/properties/border_spec.rb +0 -82
  278. data/spec/properties/cant_split_spec.rb +0 -22
  279. data/spec/properties/caps_spec.rb +0 -22
  280. data/spec/properties/character_spacing_spec.rb +0 -26
  281. data/spec/properties/color_spec.rb +0 -29
  282. data/spec/properties/column_spec.rb +0 -30
  283. data/spec/properties/columns_spec.rb +0 -164
  284. data/spec/properties/complex_bold_spec.rb +0 -22
  285. data/spec/properties/complex_font_size_spec.rb +0 -24
  286. data/spec/properties/complex_italics_spec.rb +0 -22
  287. data/spec/properties/complex_script_formatting_spec.rb +0 -22
  288. data/spec/properties/compress_punctuation_spec.rb +0 -32
  289. data/spec/properties/conditional_formatting_spec.rb +0 -64
  290. data/spec/properties/contextual_spacing_spec.rb +0 -22
  291. data/spec/properties/div_id_spec.rb +0 -17
  292. data/spec/properties/document_grid_spec.rb +0 -37
  293. data/spec/properties/double_strikethrough_spec.rb +0 -23
  294. data/spec/properties/east_asian_layout_spec.rb +0 -55
  295. data/spec/properties/effect_spec.rb +0 -43
  296. data/spec/properties/emboss_spec.rb +0 -22
  297. data/spec/properties/emphasis_spec.rb +0 -37
  298. data/spec/properties/even_and_odd_headers_spec.rb +0 -22
  299. data/spec/properties/expansion_spec.rb +0 -34
  300. data/spec/properties/font_size_spec.rb +0 -24
  301. data/spec/properties/font_spec.rb +0 -70
  302. data/spec/properties/footer_reference_spec.rb +0 -32
  303. data/spec/properties/form_protection_spec.rb +0 -22
  304. data/spec/properties/frame_spec.rb +0 -101
  305. data/spec/properties/grid_after_spec.rb +0 -26
  306. data/spec/properties/grid_before_spec.rb +0 -26
  307. data/spec/properties/grid_span_spec.rb +0 -24
  308. data/spec/properties/header_reference_spec.rb +0 -32
  309. data/spec/properties/header_spec.rb +0 -17
  310. data/spec/properties/headers_spec.rb +0 -39
  311. data/spec/properties/hidden_spec.rb +0 -22
  312. data/spec/properties/hidden_style_spec.rb +0 -22
  313. data/spec/properties/hidden_text_spec.rb +0 -22
  314. data/spec/properties/hide_mark_spec.rb +0 -22
  315. data/spec/properties/highlight_spec.rb +0 -97
  316. data/spec/properties/imprint_spec.rb +0 -22
  317. data/spec/properties/indentation_spec.rb +0 -100
  318. data/spec/properties/italics_spec.rb +0 -22
  319. data/spec/properties/keep_lines_spec.rb +0 -22
  320. data/spec/properties/keep_next_spec.rb +0 -22
  321. data/spec/properties/kerning_spec.rb +0 -24
  322. data/spec/properties/kinsoku_spec.rb +0 -32
  323. data/spec/properties/language_spec.rb +0 -20
  324. data/spec/properties/latent_styles_exception_spec.rb +0 -68
  325. data/spec/properties/latent_styles_spec.rb +0 -323
  326. data/spec/properties/line_numbering_spec.rb +0 -43
  327. data/spec/properties/linked_style_spec.rb +0 -17
  328. data/spec/properties/manual_width_spec.rb +0 -30
  329. data/spec/properties/math_spec.rb +0 -22
  330. data/spec/properties/mirror_indent_spec.rb +0 -22
  331. data/spec/properties/next_style_spec.rb +0 -17
  332. data/spec/properties/no_proof_spec.rb +0 -23
  333. data/spec/properties/no_wrap_spec.rb +0 -22
  334. data/spec/properties/numbering_spec.rb +0 -37
  335. data/spec/properties/outline_level_spec.rb +0 -20
  336. data/spec/properties/outline_spec.rb +0 -23
  337. data/spec/properties/overflow_punctuation_spec.rb +0 -23
  338. data/spec/properties/page_borders_spec.rb +0 -129
  339. data/spec/properties/page_break_before_spec.rb +0 -22
  340. data/spec/properties/page_margins_spec.rb +0 -64
  341. data/spec/properties/page_numbering_spec.rb +0 -54
  342. data/spec/properties/page_size_spec.rb +0 -43
  343. data/spec/properties/paper_source_spec.rb +0 -30
  344. data/spec/properties/paragraph_borders_spec.rb +0 -66
  345. data/spec/properties/paragraph_style_spec.rb +0 -12
  346. data/spec/properties/parent_style_spec.rb +0 -17
  347. data/spec/properties/personal_compose_spec.rb +0 -23
  348. data/spec/properties/personal_reply_spec.rb +0 -23
  349. data/spec/properties/personal_spec.rb +0 -23
  350. data/spec/properties/phonetic_guide_alignment_spec.rb +0 -42
  351. data/spec/properties/phonetic_guide_base_font_size_spec.rb +0 -25
  352. data/spec/properties/phonetic_guide_font_size_raise_spec.rb +0 -25
  353. data/spec/properties/phonetic_guide_font_size_spec.rb +0 -25
  354. data/spec/properties/phonetic_guide_language_spec.rb +0 -12
  355. data/spec/properties/position_spec.rb +0 -26
  356. data/spec/properties/primary_style_spec.rb +0 -22
  357. data/spec/properties/right_to_left_spec.rb +0 -22
  358. data/spec/properties/rtl_gutter_spec.rb +0 -23
  359. data/spec/properties/run_style_spec.rb +0 -12
  360. data/spec/properties/section_type_spec.rb +0 -33
  361. data/spec/properties/semi_hidden_spec.rb +0 -22
  362. data/spec/properties/shading_spec.rb +0 -64
  363. data/spec/properties/shadow_property_spec.rb +0 -23
  364. data/spec/properties/small_caps_spec.rb +0 -22
  365. data/spec/properties/snap_to_grid_spec.rb +0 -32
  366. data/spec/properties/spacing_spec.rb +0 -67
  367. data/spec/properties/spec_vanish_spec.rb +0 -22
  368. data/spec/properties/strikethrough_spec.rb +0 -23
  369. data/spec/properties/style_aliases_spec.rb +0 -22
  370. data/spec/properties/style_auto_redefinition_spec.rb +0 -22
  371. data/spec/properties/style_lock_spec.rb +0 -22
  372. data/spec/properties/style_name_spec.rb +0 -17
  373. data/spec/properties/supress_auto_hyphens_spec.rb +0 -22
  374. data/spec/properties/supress_line_numbers_spec.rb +0 -22
  375. data/spec/properties/supress_overlap_spec.rb +0 -22
  376. data/spec/properties/tab_spec.rb +0 -45
  377. data/spec/properties/table_border_spec.rb +0 -119
  378. data/spec/properties/table_borders_spec.rb +0 -41
  379. data/spec/properties/table_caption_spec.rb +0 -17
  380. data/spec/properties/table_cell_border_spec.rb +0 -119
  381. data/spec/properties/table_cell_borders_spec.rb +0 -40
  382. data/spec/properties/table_cell_cell_margin_spec.rb +0 -46
  383. data/spec/properties/table_cell_fit_text_spec.rb +0 -23
  384. data/spec/properties/table_cell_margin_spec.rb +0 -40
  385. data/spec/properties/table_cell_margins_spec.rb +0 -46
  386. data/spec/properties/table_cell_spacing_spec.rb +0 -21
  387. data/spec/properties/table_cell_width_spec.rb +0 -21
  388. data/spec/properties/table_description_spec.rb +0 -17
  389. data/spec/properties/table_header_spec.rb +0 -22
  390. data/spec/properties/table_indent_spec.rb +0 -43
  391. data/spec/properties/table_layout_spec.rb +0 -24
  392. data/spec/properties/table_look_spec.rb +0 -43
  393. data/spec/properties/table_overlap_spec.rb +0 -22
  394. data/spec/properties/table_p_pr_spec.rb +0 -68
  395. data/spec/properties/table_row_height_spec.rb +0 -20
  396. data/spec/properties/table_style_spec.rb +0 -17
  397. data/spec/properties/table_width_spec.rb +0 -21
  398. data/spec/properties/tabs_spec.rb +0 -39
  399. data/spec/properties/text_alignment_spec.rb +0 -33
  400. data/spec/properties/text_direction_spec.rb +0 -47
  401. data/spec/properties/textbox_tight_wrap_spec.rb +0 -33
  402. data/spec/properties/title_page_spec.rb +0 -22
  403. data/spec/properties/ui_priority_spec.rb +0 -22
  404. data/spec/properties/underline_spec.rb +0 -45
  405. data/spec/properties/unhide_when_used_spec.rb +0 -22
  406. data/spec/properties/valign_spec.rb +0 -19
  407. data/spec/properties/vertical_alignment_spec.rb +0 -26
  408. data/spec/properties/vertical_merge_spec.rb +0 -22
  409. data/spec/properties/vertical_text_alignment_spec.rb +0 -28
  410. data/spec/properties/wafter_spec.rb +0 -21
  411. data/spec/properties/wbefore_spec.rb +0 -21
  412. data/spec/properties/web_hidden_spec.rb +0 -22
  413. data/spec/properties/widow_control_spec.rb +0 -33
  414. data/spec/properties/word_wrap_spec.rb +0 -33
  415. data/spec/section_spec.rb +0 -48
  416. data/spec/spec_helper.rb +0 -16
  417. data/spec/style_spec.rb +0 -108
  418. data/spec/support/data/elements/break_element.xml +0 -4
  419. data/spec/support/data/elements/break_with_attributes_element.xml +0 -4
  420. data/spec/support/data/elements/grid_column_element.xml +0 -4
  421. data/spec/support/data/elements/paragraph_element.xml +0 -8
  422. data/spec/support/data/elements/paragraph_with_runs_element.xml +0 -14
  423. data/spec/support/data/elements/paragraph_with_section_properties_element.xml +0 -13
  424. data/spec/support/data/elements/run_element.xml +0 -8
  425. data/spec/support/data/elements/symbol_element.xml +0 -4
  426. data/spec/support/data/elements/table_cell_element.xml +0 -8
  427. data/spec/support/data/elements/table_element.xml +0 -18
  428. data/spec/support/data/elements/table_grid_element.xml +0 -6
  429. data/spec/support/data/elements/table_row_element.xml +0 -13
  430. data/spec/support/data/elements/text_element.xml +0 -4
  431. data/spec/support/data/parts/content_types_part.xml +0 -1
  432. data/spec/support/data/parts/document_with_children_part.xml +0 -2
  433. data/spec/support/data/parts/document_with_multiple_sections_part.xml +0 -24
  434. data/spec/support/data/parts/document_with_one_section_part.xml +0 -16
  435. data/spec/support/data/parts/empty_document_part.xml +0 -1
  436. data/spec/support/data/parts/empty_footer_part.xml +0 -1
  437. data/spec/support/data/parts/empty_header_part.xml +0 -1
  438. data/spec/support/data/parts/footer_with_children_part.xml +0 -1
  439. data/spec/support/data/parts/global_rels_part.xml +0 -1
  440. data/spec/support/data/parts/header_with_children_part.xml +0 -1
  441. data/spec/support/data/parts/rels_part.xml +0 -1
  442. data/spec/support/data/parts/settings_part.xml +0 -1
  443. data/spec/support/data/parts/styles_part.xml +0 -1
  444. data/spec/support/data/parts/styles_with_custom_style_part.xml +0 -20
  445. data/spec/support/data/styles/character_styles.xml +0 -15
  446. data/spec/support/data/styles/paragraph_styles.xml +0 -11
  447. data/spec/support/element_test_macros.rb +0 -242
  448. data/spec/support/part_test_macros.rb +0 -27
  449. data/spec/support/property_test_macros.rb +0 -177
  450. data/spec/support/style_test_macros.rb +0 -33
  451. data/spec/support/value_property_test_macros.rb +0 -69
@@ -1,16 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <w:document mc:Ignorable="w14 wp14 a14" xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main" xmlns:mv="urn:schemas-microsoft-com:mac:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture">
3
- <w:body>
4
- <w:p>
5
- <w:r>
6
- <w:t>This is just a test run.</w:t>
7
- </w:r>
8
- <w:r>
9
- <w:t>But this isn&apos;t!</w:t>
10
- </w:r>
11
- </w:p>
12
- <w:sectPr>
13
- <w:bidi/>
14
- </w:sectPr>
15
- </w:body>
16
- </w:document>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?><w:document mc:Ignorable="w14 wp14 a14" xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main" xmlns:mv="urn:schemas-microsoft-com:mac:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"><w:body/></w:document>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?><w:ftr mc:Ignorable="w14 w15 wp14 a14" xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main" xmlns:mv="urn:schemas-microsoft-com:mac:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main"/>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?><w:hdr mc:Ignorable="w14 w15 wp14 a14" xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main" xmlns:mv="urn:schemas-microsoft-com:mac:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"/>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?><w:ftr mc:Ignorable="w14 w15 wp14 a14" xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main" xmlns:mv="urn:schemas-microsoft-com:mac:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main"><w:p><w:r><w:t>This is just a test run.</w:t></w:r><w:r><w:t>But this isn&apos;t!</w:t></w:r></w:p></w:ftr>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="/word/document.xml" Id="R08806881ac3c45ac"/></Relationships>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?><w:hdr mc:Ignorable="w14 w15 wp14 a14" xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main" xmlns:mv="urn:schemas-microsoft-com:mac:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"><w:p><w:r><w:t>This is just a test run.</w:t></w:r><w:r><w:t>But this isn&apos;t!</w:t></w:r></w:p></w:hdr>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="/word/styles.xml" Id="Rf06246a95c004384"/><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" Target="/word/settings.xml" Id="R1efaa81aac7a4831"/></Relationships>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" standalone="yes"?><w:settings xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:bookFoldPrinting w:val="true"/><w:bookFoldPrintingSheets w:val="4"/></w:settings>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" standalone="yes"?><w:styles xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:docDefaults><w:rPrDefault><w:rPr><w:lang w:bidi="ar-SA" w:eastAsia="en-US" w:val="en-US"/></w:rPr></w:rPrDefault><w:pPrDefault><w:pPr><w:spacing w:after="0" w:line="240" w:lineRule="auto"/></w:pPr></w:pPrDefault></w:docDefaults></w:styles>
@@ -1,20 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" standalone="yes"?>
2
- <w:styles xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
3
- <w:docDefaults>
4
- <w:rPrDefault>
5
- <w:rPr>
6
- <w:lang w:bidi="ar-SA" w:eastAsia="en-US" w:val="en-US"/>
7
- </w:rPr>
8
- </w:rPrDefault>
9
- <w:pPrDefault>
10
- <w:pPr>
11
- <w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
12
- </w:pPr>
13
- </w:pPrDefault>
14
- </w:docDefaults>
15
- <w:style w:styleId="coolStyle" w:type="paragraph">
16
- <w:pPr>
17
- <w:jc w:val="start"/>
18
- </w:pPr>
19
- </w:style>
20
- </w:styles>
@@ -1,15 +0,0 @@
1
- <?xml version="1.0"?>
2
- <styleFoo xmlns:w="http://wnamespace.com">
3
- <w:style w:styleId="anotherCoolStyle" w:type="character">
4
- <w:name w:val="anotherCoolStyle"/>
5
- <w:pPr/>
6
- <w:rPr>
7
- <w:rFonts w:ascii="Times New Roman" w:cs="Times New Roman" w:hAnsi="Times New Roman"/>
8
- <w:color w:val="FF0000"/>
9
- <w:sz w:val="20"/>
10
- <w:b w:val="0"/>
11
- <w:i w:val="0"/>
12
- <w:u w:val="none"/>
13
- </w:rPr>
14
- </w:style>
15
- </styleFoo>
@@ -1,11 +0,0 @@
1
- <?xml version="1.0"?>
2
- <styleFoo xmlns:w="http://wnamespace.com">
3
- <w:style w:styleId="coolStyle" w:type="paragraph">
4
- <w:name w:val="coolStyle"/>
5
- <w:pPr>
6
- <w:ind w:firstLine="0" w:left="0" w:right="0"/>
7
- <w:jc w:val="left"/>
8
- </w:pPr>
9
- <w:rPr/>
10
- </w:style>
11
- </styleFoo>
@@ -1,242 +0,0 @@
1
- module ElementTestMacros
2
-
3
- def element_xml(part)
4
- File.read(File.join(File.dirname(__FILE__), "data", "elements", "#{part}_element.xml")).strip
5
- end
6
-
7
- def xml(obj)
8
- doc = Nokogiri::XML::Builder.new do |xml|
9
- xml.root(root_namespaces) {
10
- obj.to_xml(xml)
11
- }
12
- end.to_xml
13
- doc_pattern =~ doc ? $1 : ""
14
- end
15
-
16
- def doc_pattern
17
- /<\?xml\sversion="1.0"\?>\n<root (?:xmlns:\w+=".+?".?)+>\n\s+([^\s].+)\n<\/root>/m
18
- end
19
-
20
- def self.included(base)
21
- attr_reader :instance, :attribute, :value, :args
22
- base.extend ClassMethods
23
- end
24
-
25
- def root_namespaces
26
- { "xmlns:wpc" => 'http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas',
27
- "xmlns:mo" => 'http://schemas.microsoft.com/office/mac/office/2008/main',
28
- "xmlns:mv" => 'urn:schemas-microsoft-com:mac:vml',
29
- "xmlns:o" => 'urn:schemas-microsoft-com:office:office',
30
- "xmlns:r" => 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',
31
- "xmlns:m" => 'http://schemas.openxmlformats.org/officeDocument/2006/math',
32
- "xmlns:v" => 'urn:schemas-microsoft-com:vml',
33
- "xmlns:wp14" => 'http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing',
34
- "xmlns:wp" => 'http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing',
35
- "xmlns:w10" => 'urn:schemas-microsoft-com:office:word',
36
- "xmlns:w14" => 'http://schemas.microsoft.com/office/word/2010/wordml',
37
- "xmlns:wpg" => 'http://schemas.microsoft.com/office/word/2010/wordprocessingGroup',
38
- "xmlns:wpi" => 'http://schemas.microsoft.com/office/word/2010/wordprocessingInk',
39
- "xmlns:wne" => 'http://schemas.microsoft.com/office/word/2006/wordml',
40
- "xmlns:wps" => 'http://schemas.microsoft.com/office/word/2010/wordprocessingShape',
41
- "xmlns:w" => "http://schemas.openxmlformats.org/wordprocessingml/2006/main",
42
- "xmlns:mc" => "http://schemas.openxmlformats.org/markup-compatibility/2006",
43
- "xmlns:a" => "http://schemas.openxmlformats.org/drawingml/2006/main",
44
- "xmlns:a14" => "http://schemas.microsoft.com/office/drawing/2010/main",
45
- "xmlns:pic" => "http://purl.oclc.org/ooxml/drawingml/main",
46
- "mc:Ignorable" => "w14 wp14 a14" }
47
- end
48
-
49
- module ClassMethods
50
-
51
- def it_should_output_correct_xml(node_xml: nil)
52
- it "should be able to output the correct XML" do
53
- if node_xml.nil?
54
- node_xml = described_class.to_s.split(/::/).last
55
- node_xml = node_xml.gsub(/(.)([A-Z])/, '\1_\2').downcase
56
- end
57
-
58
- generated_xml = Nokogiri::XML::Builder.new do |xml|
59
- xml.root("xmlns:w" => "http://wnamespace.org") {
60
- instance.to_xml(xml)
61
- }
62
- end.to_xml
63
-
64
- expect(generated_xml).to eq(element_xml(node_xml) + "\n")
65
- end
66
- end
67
-
68
- def it_should_use(tag: nil, name: nil, value: nil)
69
- context "always" do
70
- before(:each) do
71
- if value.nil?
72
- @instance = described_class.new
73
- else
74
- @instance = described_class.new(*value)
75
- end
76
- end
77
-
78
- it "should use the correct tag" do
79
- expect(instance.tag).to eq(tag)
80
- end
81
-
82
- it "should use the correct name" do
83
- expect(instance.name).to eq(name)
84
- end
85
- end
86
- end
87
-
88
- def for_attribute(attribute, displays_as: nil, with_namespace: nil, &block)
89
- attribute_context = context "for the #{attribute} attribute" do
90
- before(:each) do
91
- @attribute = attribute
92
- @display = displays_as
93
- @namespace = with_namespace
94
- end
95
- end
96
-
97
- attribute_context.class_eval &block
98
- end
99
-
100
- def with_value(values, &block)
101
- values = [values] unless values.respond_to?(:each)
102
- values.each do |value|
103
- value_context = context "with the value as #{value}" do
104
- before(:each) do
105
- @value = value
106
- end
107
- end
108
-
109
- value_context.class_eval &block
110
- end
111
- end
112
- alias :with_values :with_value
113
-
114
- def it_should_assign_successfully(*args)
115
- it "should assign successfully" do
116
- expect do
117
- obj = described_class.new *args
118
- obj.send "#{attribute}=", value
119
- end.to_not raise_error
120
- end
121
- end
122
-
123
- def it_should_raise_an_exception
124
- it "should raise an exception" do
125
- expect do
126
- obj = described_class.new
127
- obj.send "#{attribute}=", value
128
- end.to raise_error(ArgumentError)
129
- end
130
- end
131
-
132
- def it_should_output(expected_xml, *args, assign: true)
133
- it "should output the correct XML" do
134
- if assign
135
- @instance = described_class.new *args
136
- instance.send "#{attribute}=", value
137
- end
138
-
139
- expect(xml(instance)).to eq(expected_xml)
140
- end
141
- end
142
-
143
- def it_should_output_regular_xml(*args, assign: true)
144
- it "should output the expected regular XML" do
145
- @instance = described_class.new *args
146
- if assign
147
- instance.send "#{attribute}=", value
148
- end
149
-
150
- tag = instance.tag
151
- tag = "#{instance.namespace}:#{tag}" unless instance.namespace.nil?
152
- attr_name = @display
153
- attr_name = attribute if attr_name.nil?
154
- attr_name = "#{@namespace}:#{attr_name}" unless @namespace.nil?
155
- expected_xml = "<#{tag} #{attr_name}=\"#{value}\"/>"
156
- expected_xml = "<#{tag}/>" if value == false
157
-
158
- expect(xml(instance)).to eq(expected_xml)
159
- end
160
- end
161
-
162
- def with_no_attributes_set(args: nil, &block)
163
- attribute_context = context "with no attributes set, it" do
164
- before(:each) do
165
- @instance = described_class.new *Array(args)
166
- end
167
- end
168
-
169
- attribute_context.class_eval &block
170
- end
171
-
172
- def with_these_attributes_set(attributes, &block)
173
- args = attributes.delete(:args)
174
- attribute_context = context "with valid attributes set" do
175
- before(:each) do
176
- @instance = described_class.new *Array(args)
177
- attributes.each do |attr, val|
178
- instance.send "#{attr}=", val
179
- end
180
- end
181
- end
182
-
183
- attribute_context.class_eval &block
184
- end
185
-
186
- def it_should_have_property(property, as_instance_of: nil)
187
- as_instance_of ||= property
188
-
189
- context "this class" do
190
- before(:each) do
191
- @instance = described_class.new
192
- end
193
-
194
- it "should have the #{property} method defined" do
195
- expect(instance.respond_to?(property)).to be(true)
196
- end
197
-
198
- it "should have #{property} return an instance of #{as_instance_of}" do
199
- class_name = as_instance_of.to_s.split("_").map(&:capitalize).join
200
- prop_class = OpenXml::Docx::Properties.const_get class_name
201
- expect(instance.public_send(property)).to be_instance_of(prop_class)
202
- end
203
- end
204
- end
205
-
206
- def it_should_have_value_property(property, as_instance_of: nil, with_value: nil)
207
- as_instance_of ||= property
208
-
209
- context "this class" do
210
- before(:each) do
211
- @instance = described_class.new *Array(args)
212
- end
213
-
214
- it "should have the #{property} method defined" do
215
- expect(instance.respond_to?("#{property}")).to be(true)
216
- end
217
-
218
- it "should have the #{property}= method defined" do
219
- expect(instance.respond_to?("#{property}=")).to be(true)
220
- end
221
-
222
- it "should have #{property} return an instance of #{as_instance_of}" do
223
- instance.public_send "#{property}=", with_value
224
- class_name = as_instance_of.to_s.split("_").map(&:capitalize).join
225
- prop_class = OpenXml::Docx::Properties.const_get class_name
226
- expect(instance.public_send(property)).to be_instance_of(prop_class)
227
- end
228
- end
229
- end
230
-
231
- def with_arguments(*args, &block)
232
- arg_context = context "" do
233
- before(:each) do
234
- @args = args
235
- end
236
- end
237
-
238
- arg_context.class_eval &block
239
- end
240
- end
241
-
242
- end
@@ -1,27 +0,0 @@
1
- module PartTestMacros
2
-
3
- def xml(part)
4
- File.read(File.join(File.dirname(__FILE__), "data", "parts", "#{part}_part.xml")).lines.map(&:strip).join
5
- end
6
-
7
- def self.included(base)
8
- attr_reader :doc
9
- base.extend ClassMethods
10
- end
11
-
12
- module ClassMethods
13
-
14
- def it_should_output_correct_xml(part: nil)
15
- it "should be able to output the correct XML" do
16
- if part.nil?
17
- part = described_class.to_s.split(/::/).last
18
- part = part.gsub(/(.)([A-Z])/, '\1_\2').downcase
19
- end
20
-
21
- expect(doc.read).to eq(xml(part))
22
- end
23
- end
24
-
25
- end
26
-
27
- end
@@ -1,177 +0,0 @@
1
- module PropertyTestMacros
2
-
3
- def xml(obj)
4
- doc = Nokogiri::XML::Builder.new do |xml|
5
- xml.root("xmlns:w" => "http://wnamespace.org") {
6
- obj.to_xml(xml)
7
- }
8
- end.to_xml
9
- doc_pattern =~ doc ? $1 : ""
10
- end
11
-
12
- def doc_pattern
13
- /<\?xml\sversion="1.0"\?>\n<root xmlns:w="http:\/\/wnamespace.org">\n\s+([^\s].+)\n<\/root>/m
14
- end
15
-
16
- def self.included(base)
17
- attr_reader :instance, :value, :attribute
18
- base.extend ClassMethods
19
- end
20
-
21
- module ClassMethods
22
-
23
- def it_should_use(tag: nil, name: nil, value: nil)
24
- context "always" do
25
- before(:each) do
26
- if value.nil?
27
- @instance = described_class.new
28
- else
29
- @instance = described_class.new(*value)
30
- end
31
- end
32
-
33
- it "should use the correct tag" do
34
- expect(instance.tag).to eq(tag)
35
- end
36
-
37
- it "should use the correct name" do
38
- expect(instance.name).to eq(name)
39
- end
40
- end
41
- end
42
-
43
- def it_should_output(expected_xml, *values, assign: true)
44
- it "should output the correct XML" do
45
- if assign
46
- @instance = described_class.new *values
47
- instance.send "#{attribute}=", value
48
- end
49
-
50
- expect(xml(instance)).to eq(expected_xml)
51
- end
52
- end
53
-
54
- def for_attribute(attribute, &block)
55
- attribute_context = context "for the #{attribute} attribute" do
56
- before(:each) do
57
- @attribute = attribute
58
- end
59
- end
60
-
61
- attribute_context.class_eval &block
62
- end
63
-
64
- def with_value(value, &block)
65
- value_context = context "with the value as #{value}" do
66
- before(:each) do
67
- @value = value
68
- end
69
- end
70
-
71
- value_context.class_eval &block
72
- end
73
-
74
- def it_should_assign_successfully(*values)
75
- it "should assign successfully" do
76
- expect do
77
- obj = described_class.new *values
78
- obj.send "#{attribute}=", value
79
- end.to_not raise_error
80
- end
81
- end
82
-
83
- def it_should_raise_an_exception
84
- it "should raise an exception" do
85
- expect do
86
- obj = described_class.new
87
- obj.send "#{attribute}=", value
88
- end.to raise_error(ArgumentError)
89
- end
90
- end
91
-
92
- def with_no_attributes_set(&block)
93
- attribute_context = context "with no attributes set" do
94
- before(:each) do
95
- @instance = described_class.new
96
- end
97
- end
98
-
99
- attribute_context.class_eval &block
100
- end
101
-
102
- def with_these_attributes_set(attributes, &block)
103
- attribute_context = context "with valid attributes set" do
104
- before(:each) do
105
- @instance = described_class.new
106
- attributes.each do |attr, val|
107
- instance.send "#{attr}=", val
108
- end
109
- end
110
- end
111
-
112
- attribute_context.class_eval &block
113
- end
114
-
115
- def it_should_output_expected_xml(*values, expected_xml: nil)
116
- it "should output the correct XML" do
117
- @instance = described_class.new *values
118
- instance.send "#{attribute}=", value
119
- property_name, property_namespace = instance.attributes[attribute]
120
- expected_xml ||= "<w:#{instance.tag} #{property_namespace}:#{property_name}=\"#{value}\"/>"
121
-
122
- expect(xml(instance)).to eq(expected_xml)
123
- end
124
- end
125
-
126
- def it_should_assign_and_output_xml(values)
127
- values = [values] unless values.respond_to? :each
128
- values.each do |value|
129
- with_value(value) do
130
- it_should_assign_successfully
131
- it_should_output_expected_xml
132
- end
133
- end
134
- end
135
-
136
- def it_should_behave_like_a_boolean_attribute
137
- with_value(true) do
138
- it_should_assign_successfully
139
- it_should_output_expected_xml
140
- end
141
-
142
- with_value(false) do
143
- it_should_assign_successfully
144
- it_should_output_expected_xml
145
- end
146
- end
147
-
148
- def it_should_not_allow_invalid_value
149
- with_value(:invalid) do
150
- it_should_raise_an_exception
151
- end
152
- end
153
-
154
- def it_should_not_allow_integers
155
- with_value(1) do
156
- it_should_raise_an_exception
157
- end
158
- end
159
- def it_should_not_allow_floats
160
- with_value(12.1) do
161
- it_should_raise_an_exception
162
- end
163
- end
164
-
165
- def it_should_not_allow_negative_numbers
166
- with_value(-1) do
167
- it_should_raise_an_exception
168
- end
169
- end
170
-
171
- def it_should_not_allow_nil
172
- with_value(nil) do
173
- it_should_raise_an_exception
174
- end
175
- end
176
- end
177
- end