openxml-docx 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/examples/booklet-printing +55 -0
- data/lib/openxml/docx/attribute_builder.rb +11 -5
- data/lib/openxml/docx/elements/absolute_position_tab.rb +1 -1
- data/lib/openxml/docx/elements/background.rb +16 -0
- data/lib/openxml/docx/elements/book_fold_printing.rb +1 -1
- data/lib/openxml/docx/elements/book_fold_reverse_printing.rb +1 -1
- data/lib/openxml/docx/elements/compatibility_setting.rb +10 -0
- data/lib/openxml/docx/elements/compatibility_settings.rb +15 -0
- data/lib/openxml/docx/elements/embed_bold.rb +2 -10
- data/lib/openxml/docx/elements/embed_bold_italic.rb +2 -10
- data/lib/openxml/docx/elements/embed_italic.rb +2 -10
- data/lib/openxml/docx/elements/embed_regular.rb +3 -3
- data/lib/openxml/docx/elements/embed_system_fonts.rb +1 -1
- data/lib/openxml/docx/elements/embed_true_type_fonts.rb +1 -1
- data/lib/openxml/docx/elements/even_and_odd_headers.rb +11 -0
- data/lib/openxml/docx/elements/family.rb +1 -1
- data/lib/openxml/docx/elements/markup_compatibility_choice.rb +1 -1
- data/lib/openxml/docx/elements/paragraph.rb +1 -0
- data/lib/openxml/docx/elements/save_subset_fonts.rb +1 -1
- data/lib/openxml/docx/elements/table_cell.rb +1 -0
- data/lib/openxml/docx/elements/textbox_content.rb +9 -0
- data/lib/openxml/docx/elements/word_processing_drawing_anchor.rb +6 -6
- data/lib/openxml/docx/elements/word_processing_drawing_inline.rb +16 -0
- data/lib/openxml/docx/elements/word_processing_drawing_object_nv_properties.rb +1 -1
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_polygon.rb +1 -1
- data/lib/openxml/docx/elements/word_processing_shapes_body_properties.rb +12 -12
- data/lib/openxml/docx/elements/word_processing_shapes_nv_drawing_properties.rb +1 -1
- data/lib/openxml/docx/elements/word_processing_shapes_shape.rb +1 -2
- data/lib/openxml/docx/elements/word_processing_shapes_shape_properties.rb +1 -11
- data/lib/openxml/docx/elements/word_processing_shapes_textual_contents.rb +13 -0
- data/lib/openxml/{drawingml → docx}/elements/wordprocessing_shape_group.rb +1 -1
- data/lib/openxml/docx/package.rb +4 -3
- data/lib/openxml/docx/parts/document.rb +5 -0
- data/lib/openxml/docx/parts/header.rb +1 -1
- data/lib/openxml/docx/properties.rb +1 -0
- data/lib/openxml/docx/properties/border.rb +2 -2
- data/lib/openxml/docx/properties/columns.rb +8 -2
- data/lib/openxml/docx/properties/conditional_formatting.rb +12 -12
- data/lib/openxml/docx/properties/container_property.rb +10 -10
- data/lib/openxml/docx/properties/footer_references.rb +12 -0
- data/lib/openxml/docx/properties/frame.rb +1 -1
- data/lib/openxml/docx/properties/header_references.rb +12 -0
- data/lib/openxml/docx/properties/indentation.rb +5 -1
- data/lib/openxml/docx/properties/latent_styles.rb +4 -4
- data/lib/openxml/docx/properties/latent_styles_exception.rb +4 -4
- data/lib/openxml/docx/properties/section.rb +15 -0
- data/lib/openxml/docx/properties/table_border.rb +2 -2
- data/lib/openxml/docx/properties/table_cell_border.rb +2 -2
- data/lib/openxml/docx/properties/table_look.rb +7 -6
- data/lib/openxml/docx/properties/text_direction.rb +1 -1
- data/lib/openxml/docx/properties/transparent_container_property.rb +14 -0
- data/lib/openxml/docx/properties/vertical_merge.rb +14 -0
- data/lib/openxml/docx/section.rb +2 -0
- data/lib/openxml/docx/style.rb +18 -6
- data/lib/openxml/docx/version.rb +1 -1
- data/lib/openxml/drawingml/elements/blip_fill.rb +1 -1
- data/lib/openxml/drawingml/elements/children_extents.rb +14 -0
- data/lib/openxml/drawingml/elements/children_offset.rb +14 -0
- data/lib/openxml/drawingml/elements/graphic_frame_locks.rb +6 -6
- data/lib/openxml/drawingml/elements/no_autofit.rb +10 -0
- data/lib/openxml/drawingml/elements/no_fill.rb +1 -1
- data/lib/openxml/drawingml/elements/non_visual_drawing_properties.rb +1 -1
- data/lib/openxml/drawingml/elements/non_visual_picture_drawing_properties.rb +1 -1
- data/lib/openxml/drawingml/elements/non_visual_shape_drawing_properties.rb +12 -0
- data/lib/openxml/drawingml/elements/picture_locks.rb +11 -11
- data/lib/openxml/drawingml/elements/preset_text_warp.rb +25 -0
- data/lib/openxml/vml/elements/group.rb +17 -37
- data/lib/openxml/vml/elements/rectangle.rb +29 -62
- data/lib/openxml/vml/elements/rounded_rectangle.rb +29 -61
- data/spec/elements/absolute_position_tab_spec.rb +21 -15
- data/spec/elements/background_spec.rb +52 -0
- data/spec/elements/bidi_embed_spec.rb +12 -4
- data/spec/elements/bidi_override_spec.rb +12 -4
- data/spec/elements/break_spec.rb +12 -10
- data/spec/elements/compatibility_setting_spec.rb +41 -0
- data/spec/elements/compatibility_settings_spec.rb +8 -0
- data/spec/elements/content_part_spec.rb +2 -2
- data/spec/elements/control_spec.rb +5 -5
- data/spec/elements/deleted_text_spec.rb +2 -2
- data/spec/elements/drawingml/blip_fill_spec.rb +8 -3
- data/spec/elements/drawingml/extents_spec.rb +4 -4
- data/spec/elements/drawingml/head_end_spec.rb +16 -13
- data/spec/elements/drawingml/no_autofit_spec.rb +8 -0
- data/spec/elements/drawingml/non_visual_drawing_properties_spec.rb +6 -6
- data/spec/elements/drawingml/non_visual_shape_drawing_properties_spec.rb +24 -0
- data/spec/elements/drawingml/offset_spec.rb +14 -4
- data/spec/elements/drawingml/outline_spec.rb +20 -14
- data/spec/elements/drawingml/preset_geometry_spec.rb +1 -1
- data/spec/elements/drawingml/preset_text_warp_spec.rb +36 -0
- data/spec/elements/drawingml/shape_guide_spec.rb +7 -3
- data/spec/elements/drawingml/srgb_color_spec.rb +3 -4
- data/spec/elements/drawingml/tail_end_spec.rb +17 -14
- data/spec/elements/drawingml/transform_effect_spec.rb +48 -26
- data/spec/elements/markup_compatibility_choice_spec.rb +2 -2
- data/spec/elements/paragraph_spec.rb +25 -0
- data/spec/elements/symbol_spec.rb +4 -4
- data/spec/elements/text_spec.rb +1 -1
- data/spec/elements/textbox_content_spec.rb +8 -0
- data/spec/elements/vml/group_spec.rb +367 -375
- data/spec/elements/vml/rectangle_spec.rb +503 -513
- data/spec/elements/vml/rounded_rectangle_spec.rb +591 -463
- data/spec/elements/word_processing_drawing_effect_extent_spec.rb +32 -12
- data/spec/elements/word_processing_drawing_extent_spec.rb +4 -4
- data/spec/elements/word_processing_drawing_object_nv_properties_spec.rb +6 -6
- data/spec/elements/word_processing_drawing_simple_position_spec.rb +16 -6
- data/spec/elements/word_processing_shapes_body_properties_spec.rb +53 -44
- data/spec/elements/word_processing_shapes_shape_properties_spec.rb +6 -5
- data/spec/elements/word_processing_shapes_shape_spec.rb +2 -2
- data/spec/elements/word_processing_shapes_textual_content_spec.rb +23 -0
- data/spec/elements/{drawingml/wordprocessing_shape_group_spec.rb → wordprocessing_shape_group_spec.rb} +1 -1
- data/spec/properties/indentation_spec.rb +28 -0
- data/spec/properties/table_look_spec.rb +5 -0
- data/spec/properties/text_direction_spec.rb +5 -0
- data/spec/properties/vertical_merge_spec.rb +22 -0
- data/spec/support/data/elements/paragraph_with_section_properties_element.xml +12 -0
- data/spec/support/data/parts/empty_header_part.xml +1 -1
- data/spec/support/data/parts/header_with_children_part.xml +1 -1
- metadata +76 -27
- checksums.yaml +0 -7
@@ -9,11 +9,12 @@ describe OpenXml::Docx::Elements::AbsolutePositionTab do
|
|
9
9
|
it_should_output "<w:ptab/>", assign: false
|
10
10
|
end
|
11
11
|
|
12
|
-
for_attribute(:alignment
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
for_attribute(:alignment) do
|
13
|
+
%i(center left right).each do |allowed_value|
|
14
|
+
with_value(allowed_value) do
|
15
|
+
it_should_assign_successfully
|
16
|
+
it_should_output "<w:ptab w:alignment=\"#{allowed_value}\"/>"
|
17
|
+
end
|
17
18
|
end
|
18
19
|
|
19
20
|
with_value(:somethingElse) do
|
@@ -21,11 +22,12 @@ describe OpenXml::Docx::Elements::AbsolutePositionTab do
|
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
24
|
-
for_attribute(:leader
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
for_attribute(:leader) do
|
26
|
+
%i(dot hyphen middleDot none underscore).each do |allowed_value|
|
27
|
+
with_value(allowed_value) do
|
28
|
+
it_should_assign_successfully
|
29
|
+
it_should_output "<w:ptab w:leader=\"#{allowed_value}\"/>"
|
30
|
+
end
|
29
31
|
end
|
30
32
|
|
31
33
|
with_value(:somethingElse) do
|
@@ -33,11 +35,15 @@ describe OpenXml::Docx::Elements::AbsolutePositionTab do
|
|
33
35
|
end
|
34
36
|
end
|
35
37
|
|
36
|
-
for_attribute(:
|
37
|
-
|
38
|
-
|
38
|
+
for_attribute(:relative_to) do
|
39
|
+
with_value(:indent) do
|
40
|
+
it_should_assign_successfully
|
41
|
+
it_should_output "<w:ptab w:relativeTo=\"indent\"/>"
|
42
|
+
end
|
43
|
+
|
44
|
+
with_value(:margin) do
|
39
45
|
it_should_assign_successfully
|
40
|
-
|
46
|
+
it_should_output "<w:ptab w:relativeTo=\"margin\"/>"
|
41
47
|
end
|
42
48
|
|
43
49
|
with_value(:somethingElse) do
|
@@ -45,7 +51,7 @@ describe OpenXml::Docx::Elements::AbsolutePositionTab do
|
|
45
51
|
end
|
46
52
|
end
|
47
53
|
|
48
|
-
with_these_attributes_set(alignment: :center,
|
54
|
+
with_these_attributes_set(alignment: :center, relative_to: :margin) do
|
49
55
|
it_should_output "<w:ptab w:alignment=\"center\" w:relativeTo=\"margin\"/>", assign: false
|
50
56
|
end
|
51
57
|
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::Docx::Elements::Background do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :background, name: "background"
|
7
|
+
|
8
|
+
for_attribute(:color) do
|
9
|
+
with_value("FF00AA") do
|
10
|
+
it_should_assign_successfully
|
11
|
+
it_should_output "<w:background w:color=\"FF00AA\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_values([:blue, "1ff0aa"]) do
|
15
|
+
it_should_raise_an_exception
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
for_attribute(:theme_color) do
|
20
|
+
with_value(:accent1) do
|
21
|
+
it_should_assign_successfully
|
22
|
+
it_should_output "<w:background w:themeColor=\"accent1\"/>"
|
23
|
+
end
|
24
|
+
|
25
|
+
with_value(:not_allowed) do
|
26
|
+
it_should_raise_an_exception
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
for_attribute(:theme_shade) do
|
31
|
+
with_value("0F") do
|
32
|
+
it_should_assign_successfully
|
33
|
+
it_should_output "<w:background w:themeShade=\"0F\"/>"
|
34
|
+
end
|
35
|
+
|
36
|
+
with_values([:red, "00FF", "0f"]) do
|
37
|
+
it_should_raise_an_exception
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
for_attribute(:theme_tint) do
|
42
|
+
with_value("0F") do
|
43
|
+
it_should_assign_successfully
|
44
|
+
it_should_output "<w:background w:themeTint=\"0F\"/>"
|
45
|
+
end
|
46
|
+
|
47
|
+
with_values([:red, "00FF", "0f"]) do
|
48
|
+
it_should_raise_an_exception
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
@@ -5,11 +5,19 @@ describe OpenXml::Docx::Elements::BidiEmbed do
|
|
5
5
|
|
6
6
|
it_should_use tag: :dir, name: "bidi_embed"
|
7
7
|
|
8
|
-
for_attribute(:direction
|
9
|
-
|
10
|
-
with_values(allowed) do
|
8
|
+
for_attribute(:direction) do
|
9
|
+
with_value(:rtl) do
|
11
10
|
it_should_assign_successfully
|
12
|
-
|
11
|
+
it_should_output "<w:dir w:val=\"rtl\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_value(:ltr) do
|
15
|
+
it_should_assign_successfully
|
16
|
+
it_should_output "<w:dir w:val=\"ltr\"/>"
|
17
|
+
end
|
18
|
+
|
19
|
+
with_value(:not_allowed) do
|
20
|
+
it_should_raise_an_exception
|
13
21
|
end
|
14
22
|
end
|
15
23
|
|
@@ -5,11 +5,19 @@ describe OpenXml::Docx::Elements::BidiOverride do
|
|
5
5
|
|
6
6
|
it_should_use tag: :bdo, name: "bidi_override"
|
7
7
|
|
8
|
-
for_attribute(:direction
|
9
|
-
|
10
|
-
with_values(allowed) do
|
8
|
+
for_attribute(:direction) do
|
9
|
+
with_value(:rtl) do
|
11
10
|
it_should_assign_successfully
|
12
|
-
|
11
|
+
it_should_output "<w:bdo w:val=\"rtl\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_value(:ltr) do
|
15
|
+
it_should_assign_successfully
|
16
|
+
it_should_output "<w:bdo w:val=\"ltr\"/>"
|
17
|
+
end
|
18
|
+
|
19
|
+
with_value(:not_allowed) do
|
20
|
+
it_should_raise_an_exception
|
13
21
|
end
|
14
22
|
end
|
15
23
|
|
data/spec/elements/break_spec.rb
CHANGED
@@ -5,11 +5,12 @@ describe OpenXml::Docx::Elements::Break do
|
|
5
5
|
|
6
6
|
it_should_use tag: :br, name: "break"
|
7
7
|
|
8
|
-
for_attribute(:clear
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
for_attribute(:clear) do
|
9
|
+
%i(all left none right).each do |allowed_value|
|
10
|
+
with_value(allowed_value) do
|
11
|
+
it_should_assign_successfully
|
12
|
+
it_should_output "<w:br w:clear=\"#{allowed_value}\"/>"
|
13
|
+
end
|
13
14
|
end
|
14
15
|
|
15
16
|
with_value(:somethingElse) do
|
@@ -17,11 +18,12 @@ describe OpenXml::Docx::Elements::Break do
|
|
17
18
|
end
|
18
19
|
end
|
19
20
|
|
20
|
-
for_attribute(:type
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
for_attribute(:type) do
|
22
|
+
%i(column page textWrapping).each do |allowed_value|
|
23
|
+
with_value(allowed_value) do
|
24
|
+
it_should_assign_successfully
|
25
|
+
it_should_output "<w:br w:type=\"#{allowed_value}\"/>"
|
26
|
+
end
|
25
27
|
end
|
26
28
|
|
27
29
|
with_value(:somethingElse) do
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::Docx::Elements::CompatibilitySetting do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :compatSetting, name: "compatibility_setting"
|
7
|
+
|
8
|
+
for_attribute(:setting_name) do
|
9
|
+
with_value("A String") do
|
10
|
+
it_should_assign_successfully
|
11
|
+
it_should_output "<w:compatSetting w:name=\"A String\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_values([0, :not_a_string]) do
|
15
|
+
it_should_raise_an_exception
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
for_attribute(:uri) do
|
20
|
+
with_value("A String") do
|
21
|
+
it_should_assign_successfully
|
22
|
+
it_should_output "<w:compatSetting w:uri=\"A String\"/>"
|
23
|
+
end
|
24
|
+
|
25
|
+
with_values([0, :not_a_string]) do
|
26
|
+
it_should_raise_an_exception
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
for_attribute(:value) do
|
31
|
+
with_value("A String") do
|
32
|
+
it_should_assign_successfully
|
33
|
+
it_should_output "<w:compatSetting w:val=\"A String\"/>"
|
34
|
+
end
|
35
|
+
|
36
|
+
with_values([0, :not_a_string]) do
|
37
|
+
it_should_raise_an_exception
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
@@ -5,10 +5,10 @@ describe OpenXml::Docx::Elements::ContentPart do
|
|
5
5
|
|
6
6
|
it_should_use tag: :contentPart, name: "content_part"
|
7
7
|
|
8
|
-
for_attribute(:id
|
8
|
+
for_attribute(:id) do
|
9
9
|
with_value("rId8") do
|
10
10
|
it_should_assign_successfully
|
11
|
-
|
11
|
+
it_should_output "<w:contentPart r:id=\"rId8\"/>"
|
12
12
|
end
|
13
13
|
|
14
14
|
with_value("") do
|
@@ -5,10 +5,10 @@ describe OpenXml::Docx::Elements::Control do
|
|
5
5
|
|
6
6
|
it_should_use tag: :control, name: "control"
|
7
7
|
|
8
|
-
for_attribute(:id
|
8
|
+
for_attribute(:id) do
|
9
9
|
with_value("rId5") do
|
10
10
|
it_should_assign_successfully
|
11
|
-
|
11
|
+
it_should_output "<w:control r:id=\"rId5\"/>"
|
12
12
|
end
|
13
13
|
|
14
14
|
with_value("") do
|
@@ -16,10 +16,10 @@ describe OpenXml::Docx::Elements::Control do
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
for_attribute(:unique_name
|
19
|
+
for_attribute(:unique_name) do
|
20
20
|
with_value("CheckBox1") do
|
21
21
|
it_should_assign_successfully
|
22
|
-
|
22
|
+
it_should_output "<w:control w:name=\"CheckBox1\"/>"
|
23
23
|
end
|
24
24
|
|
25
25
|
with_value("") do
|
@@ -30,7 +30,7 @@ describe OpenXml::Docx::Elements::Control do
|
|
30
30
|
for_attribute(:shape_id, displays_as: :shapeid, with_namespace: :w) do
|
31
31
|
with_value("_x0000_s1027") do
|
32
32
|
it_should_assign_successfully
|
33
|
-
|
33
|
+
it_should_output "<w:control w:shapeid=\"_x0000_s1027\"/>"
|
34
34
|
end
|
35
35
|
|
36
36
|
with_value("") do
|
@@ -5,7 +5,7 @@ describe OpenXml::Docx::Elements::DeletedText do
|
|
5
5
|
|
6
6
|
it_should_use tag: :del, name: "deleted_text"
|
7
7
|
|
8
|
-
for_attribute(:space
|
8
|
+
for_attribute(:space) do
|
9
9
|
with_value(nil) do
|
10
10
|
it_should_assign_successfully
|
11
11
|
it_should_output "<w:del/>"
|
@@ -13,7 +13,7 @@ describe OpenXml::Docx::Elements::DeletedText do
|
|
13
13
|
|
14
14
|
with_value(:preserve) do
|
15
15
|
it_should_assign_successfully
|
16
|
-
|
16
|
+
it_should_output "<w:del xml:space=\"preserve\"/>"
|
17
17
|
end
|
18
18
|
|
19
19
|
with_value(:the_final_frontier) do
|
@@ -6,12 +6,17 @@ describe OpenXml::DrawingML::Elements::BlipFill do
|
|
6
6
|
it_should_use tag: :blipFill, name: "blip_fill"
|
7
7
|
|
8
8
|
for_attribute(:dpi) do
|
9
|
-
|
9
|
+
with_value(1) do
|
10
10
|
it_should_assign_successfully
|
11
|
-
|
11
|
+
it_should_output "<pic:blipFill dpi=\"1\"/>"
|
12
12
|
end
|
13
13
|
|
14
|
-
with_value(
|
14
|
+
with_value(-1) do
|
15
|
+
it_should_assign_successfully
|
16
|
+
it_should_output "<pic:blipFill dpi=\"-1\"/>"
|
17
|
+
end
|
18
|
+
|
19
|
+
with_values([:not_a_number, 12.34]) do
|
15
20
|
it_should_raise_an_exception
|
16
21
|
end
|
17
22
|
end
|
@@ -7,10 +7,10 @@ describe OpenXml::DrawingML::Elements::Extents do
|
|
7
7
|
|
8
8
|
attributes = { extent_length: :cx, extent_width: :cy }
|
9
9
|
|
10
|
-
for_attribute(:extent_length
|
10
|
+
for_attribute(:extent_length) do
|
11
11
|
with_value(1) do
|
12
12
|
it_should_assign_successfully
|
13
|
-
|
13
|
+
it_should_output "<a:ext cx=\"1\"/>"
|
14
14
|
end
|
15
15
|
|
16
16
|
with_values([-1, 1.1, :not_a_number]) do
|
@@ -18,10 +18,10 @@ describe OpenXml::DrawingML::Elements::Extents do
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
for_attribute(:extent_width
|
21
|
+
for_attribute(:extent_width) do
|
22
22
|
with_value(1) do
|
23
23
|
it_should_assign_successfully
|
24
|
-
|
24
|
+
it_should_output "<a:ext cy=\"1\"/>"
|
25
25
|
end
|
26
26
|
|
27
27
|
with_values([-1, 1.1, :not_a_number]) do
|
@@ -5,11 +5,12 @@ describe OpenXml::DrawingML::Elements::HeadEnd do
|
|
5
5
|
|
6
6
|
it_should_use tag: :headEnd, name: "head_end"
|
7
7
|
|
8
|
-
for_attribute(:length
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
for_attribute(:length) do
|
9
|
+
%i(lg med sm).each do |allowed_value|
|
10
|
+
with_value(allowed_value) do
|
11
|
+
it_should_assign_successfully
|
12
|
+
it_should_output "<a:headEnd len=\"#{allowed_value}\"/>"
|
13
|
+
end
|
13
14
|
end
|
14
15
|
|
15
16
|
with_value(:bad_value) do
|
@@ -18,10 +19,11 @@ describe OpenXml::DrawingML::Elements::HeadEnd do
|
|
18
19
|
end
|
19
20
|
|
20
21
|
for_attribute(:type) do
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
%i(arrow diamond none oval stealth triangle).each do |allowed_value|
|
23
|
+
with_value(allowed_value) do
|
24
|
+
it_should_assign_successfully
|
25
|
+
it_should_output "<a:headEnd type=\"#{allowed_value}\"/>"
|
26
|
+
end
|
25
27
|
end
|
26
28
|
|
27
29
|
with_value(:bad_value) do
|
@@ -30,10 +32,11 @@ describe OpenXml::DrawingML::Elements::HeadEnd do
|
|
30
32
|
end
|
31
33
|
|
32
34
|
for_attribute(:width, displays_as: :w) do
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
35
|
+
%i(lg med sm).each do |allowed_value|
|
36
|
+
with_value(allowed_value) do
|
37
|
+
it_should_assign_successfully
|
38
|
+
it_should_output "<a:headEnd w=\"#{allowed_value}\"/>"
|
39
|
+
end
|
37
40
|
end
|
38
41
|
|
39
42
|
with_value(:bad_value) do
|
@@ -5,10 +5,10 @@ describe OpenXml::DrawingML::Elements::NonVisualDrawingProperties do
|
|
5
5
|
|
6
6
|
it_should_use tag: :cNvPr, name: "non_visual_drawing_properties"
|
7
7
|
|
8
|
-
for_attribute(:description
|
8
|
+
for_attribute(:description) do
|
9
9
|
with_value("string") do
|
10
10
|
it_should_assign_successfully
|
11
|
-
|
11
|
+
it_should_output "<pic:cNvPr descr=\"string\"/>"
|
12
12
|
end
|
13
13
|
|
14
14
|
with_value(:not_a_string) do
|
@@ -35,7 +35,7 @@ describe OpenXml::DrawingML::Elements::NonVisualDrawingProperties do
|
|
35
35
|
for_attribute(:id) do
|
36
36
|
with_value(123) do
|
37
37
|
it_should_assign_successfully
|
38
|
-
|
38
|
+
it_should_output "<pic:cNvPr id=\"123\"/>"
|
39
39
|
end
|
40
40
|
|
41
41
|
with_values([-123, :not_a_number]) do
|
@@ -43,10 +43,10 @@ describe OpenXml::DrawingML::Elements::NonVisualDrawingProperties do
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
for_attribute(:picture_name
|
46
|
+
for_attribute(:picture_name) do
|
47
47
|
with_value("string") do
|
48
48
|
it_should_assign_successfully
|
49
|
-
|
49
|
+
it_should_output "<pic:cNvPr name=\"string\"/>"
|
50
50
|
end
|
51
51
|
|
52
52
|
with_value(:not_a_string) do
|
@@ -57,7 +57,7 @@ describe OpenXml::DrawingML::Elements::NonVisualDrawingProperties do
|
|
57
57
|
for_attribute(:title) do
|
58
58
|
with_value("string") do
|
59
59
|
it_should_assign_successfully
|
60
|
-
|
60
|
+
it_should_output "<pic:cNvPr title=\"string\"/>"
|
61
61
|
end
|
62
62
|
|
63
63
|
with_value(:not_a_string) do
|