openxml-docx 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/examples/drawing-ml +1 -1
- data/examples/image-embedding +141 -0
- data/examples/ochanomizu.jpg +0 -0
- data/lib/openxml/docx.rb +8 -0
- data/lib/openxml/docx/attribute_builder.rb +11 -1
- data/lib/openxml/docx/elements/book_fold_printing.rb +12 -0
- data/lib/openxml/docx/elements/book_fold_printing_sheets.rb +12 -0
- data/lib/openxml/docx/elements/book_fold_reverse_printing.rb +12 -0
- data/lib/openxml/docx/elements/drawing.rb +1 -1
- data/lib/openxml/docx/elements/embed_system_fonts.rb +14 -0
- data/lib/openxml/docx/elements/embed_true_type_fonts.rb +14 -0
- data/lib/openxml/docx/elements/font_alternate_name.rb +15 -0
- data/lib/openxml/docx/elements/font_character_set.rb +15 -0
- data/lib/openxml/docx/elements/font_panose_one.rb +15 -0
- data/lib/openxml/docx/elements/font_pitch.rb +15 -0
- data/lib/openxml/docx/elements/font_sig.rb +20 -0
- data/lib/openxml/docx/elements/save_subset_fonts.rb +14 -0
- data/lib/openxml/docx/elements/word_processing_drawing_anchor.rb +13 -11
- data/lib/openxml/docx/elements/word_processing_drawing_object_nv_properties.rb +1 -1
- data/lib/openxml/docx/elements/word_processing_drawing_position_h.rb +1 -11
- data/lib/openxml/docx/elements/word_processing_drawing_position_offset.rb +18 -1
- data/lib/openxml/docx/elements/word_processing_drawing_position_v.rb +1 -11
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_coordinate.rb +26 -0
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_polygon.rb +13 -0
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_square.rb +17 -0
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_through.rb +15 -0
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_tight.rb +15 -0
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_top_and_bottom.rb +14 -0
- data/lib/openxml/docx/elements/word_processing_groups_group_shape_properties.rb +13 -0
- data/lib/openxml/docx/elements/word_processing_groups_nv_shape_drawing_properties.rb +11 -0
- data/lib/openxml/docx/elements/word_processing_shapes_nv_drawing_properties.rb +17 -0
- data/lib/openxml/docx/package.rb +39 -13
- data/lib/openxml/docx/parts/document.rb +3 -2
- data/lib/openxml/docx/parts/fonts.rb +2 -1
- data/lib/openxml/docx/parts/footer.rb +2 -1
- data/lib/openxml/docx/parts/header.rb +2 -1
- data/lib/openxml/docx/parts/settings.rb +5 -0
- data/lib/openxml/docx/properties/tabs.rb +2 -0
- data/lib/openxml/docx/root_namespaces.rb +1 -1
- data/lib/openxml/docx/version.rb +1 -1
- data/lib/openxml/drawingml/elements/blip.rb +18 -0
- data/lib/openxml/drawingml/elements/blip_fill.rb +1 -1
- data/lib/openxml/drawingml/elements/fill_rectangle.rb +16 -0
- data/lib/openxml/drawingml/elements/graphic_frame_locks.rb +6 -6
- data/lib/openxml/drawingml/elements/non_visual_drawing_properties.rb +1 -1
- data/lib/openxml/drawingml/elements/picture_locks.rb +23 -0
- data/lib/openxml/drawingml/elements/picture_shape_properties.rb +13 -0
- data/lib/openxml/drawingml/elements/source_rectangle.rb +16 -0
- data/lib/openxml/drawingml/elements/stretch.rb +10 -0
- data/spec/elements/book_fold_printing_sheets_spec.rb +27 -0
- data/spec/elements/book_fold_printing_spec.rb +19 -0
- data/spec/elements/book_fold_reverse_printing_spec.rb +19 -0
- data/spec/elements/drawingml/blip_fill_spec.rb +8 -3
- data/spec/elements/drawingml/blip_spec.rb +47 -0
- data/spec/elements/drawingml/fill_rectangle_spec.rb +76 -0
- data/spec/elements/drawingml/graphic_frame_locks_spec.rb +47 -18
- data/spec/elements/drawingml/non_visual_drawing_properties_spec.rb +8 -3
- data/spec/elements/drawingml/non_visual_picture_drawing_properties_spec.rb +7 -2
- data/spec/elements/drawingml/picture_locks_spec.rb +122 -0
- data/spec/elements/drawingml/picture_shape_properties_spec.rb +21 -0
- data/spec/elements/drawingml/source_rectangle_spec.rb +76 -0
- data/spec/elements/drawingml/stretch_spec.rb +8 -0
- data/spec/elements/embed_system_fonts_spec.rb +19 -0
- data/spec/elements/embed_true_type_fonts_spec.rb +19 -0
- data/spec/elements/font_alternate_name_spec.rb +19 -0
- data/spec/elements/font_character_set_spec.rb +19 -0
- data/spec/elements/font_panose_one_spec.rb +19 -0
- data/spec/elements/font_pitch_spec.rb +21 -0
- data/spec/elements/font_sig_spec.rb +74 -0
- data/spec/elements/save_subset_fonts_spec.rb +19 -0
- data/spec/elements/word_processing_drawing_anchor_spec.rb +107 -25
- data/spec/elements/word_processing_drawing_object_nv_properties_spec.rb +1 -1
- data/spec/elements/word_processing_drawing_position_h_spec.rb +6 -5
- data/spec/elements/word_processing_drawing_position_v_spec.rb +6 -5
- data/spec/elements/word_processing_drawing_wrap_coordinate_spec.rb +40 -0
- data/spec/elements/word_processing_drawing_wrap_polygon_spec.rb +23 -0
- data/spec/elements/word_processing_drawing_wrap_square_spec.rb +65 -0
- data/spec/elements/word_processing_drawing_wrap_through_spec.rb +43 -0
- data/spec/elements/word_processing_drawing_wrap_tight_spec.rb +43 -0
- data/spec/elements/word_processing_drawing_wrap_top_and_bottom_spec.rb +30 -0
- data/spec/elements/word_processing_groups_group_shape_properties_spec.rb +21 -0
- data/spec/elements/word_processing_groups_nv_shape_drawing_properties_spec.rb +8 -0
- data/spec/elements/word_processing_shapes_nv_drawing_properties_spec.rb +64 -0
- data/spec/package_spec.rb +2 -2
- data/spec/parts/settings_spec.rb +6 -0
- data/spec/properties/table_border_spec.rb +2 -2
- data/spec/properties/table_cell_border_spec.rb +2 -2
- data/spec/style_spec.rb +2 -2
- data/spec/support/data/parts/document_with_children_part.xml +1 -1
- data/spec/support/data/parts/document_with_multiple_sections_part.xml +1 -1
- data/spec/support/data/parts/document_with_one_section_part.xml +1 -1
- data/spec/support/data/parts/empty_document_part.xml +1 -1
- data/spec/support/data/parts/settings_part.xml +1 -1
- data/spec/support/property_test_macros.rb +1 -1
- metadata +56 -2
@@ -5,7 +5,7 @@ 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(:descr) do
|
8
|
+
for_attribute(:description, displays_as: :descr) do
|
9
9
|
with_value("string") do
|
10
10
|
it_should_assign_successfully
|
11
11
|
it_should_output_regular_xml
|
@@ -17,9 +17,14 @@ describe OpenXml::DrawingML::Elements::NonVisualDrawingProperties do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
for_attribute(:hidden) do
|
20
|
-
|
20
|
+
with_value(true) do
|
21
21
|
it_should_assign_successfully
|
22
|
-
|
22
|
+
it_should_output "<pic:cNvPr hidden=\"true\"/>"
|
23
|
+
end
|
24
|
+
|
25
|
+
with_value(false) do
|
26
|
+
it_should_assign_successfully
|
27
|
+
it_should_output "<pic:cNvPr hidden=\"false\"/>"
|
23
28
|
end
|
24
29
|
|
25
30
|
with_value(:not_a_boolean) do
|
@@ -6,9 +6,14 @@ describe OpenXml::DrawingML::Elements::NonVisualPictureDrawingProperties do
|
|
6
6
|
it_should_use tag: :cNvPicPr, name: "non_visual_picture_drawing_properties"
|
7
7
|
|
8
8
|
for_attribute(:preferRelativeResize) do
|
9
|
-
|
9
|
+
with_value(true) do
|
10
10
|
it_should_assign_successfully
|
11
|
-
|
11
|
+
it_should_output "<pic:cNvPicPr preferRelativeResize=\"true\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_value(false) do
|
15
|
+
it_should_assign_successfully
|
16
|
+
it_should_output "<pic:cNvPicPr preferRelativeResize=\"false\"/>"
|
12
17
|
end
|
13
18
|
|
14
19
|
with_value(:not_a_boolean) do
|
@@ -0,0 +1,122 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::DrawingML::Elements::PictureLocks do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :picLocks, name: "picture_locks"
|
7
|
+
|
8
|
+
for_attribute(:hide_adjust_handles) do
|
9
|
+
with_value(true) do
|
10
|
+
it_should_assign_successfully
|
11
|
+
it_should_output "<a:picLocks noAdjustHandles=\"true\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_value(:not_a_boolean) do
|
15
|
+
it_should_raise_an_exception
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
for_attribute(:disallow_arrowhead_changes) do
|
20
|
+
with_value(true) do
|
21
|
+
it_should_assign_successfully
|
22
|
+
it_should_output "<a:picLocks noChangeArrowheads=\"true\"/>"
|
23
|
+
end
|
24
|
+
|
25
|
+
with_value(:not_a_boolean) do
|
26
|
+
it_should_raise_an_exception
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
for_attribute(:disallow_aspect_ratio_changes) do
|
31
|
+
with_value(true) do
|
32
|
+
it_should_assign_successfully
|
33
|
+
it_should_output "<a:picLocks noChangeAspect=\"true\"/>"
|
34
|
+
end
|
35
|
+
|
36
|
+
with_value(:not_a_boolean) do
|
37
|
+
it_should_raise_an_exception
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
for_attribute(:disallow_shape_type_changes) do
|
42
|
+
with_value(true) do
|
43
|
+
it_should_assign_successfully
|
44
|
+
it_should_output "<a:picLocks noChangeShapeType=\"true\"/>"
|
45
|
+
end
|
46
|
+
|
47
|
+
with_value(:not_a_boolean) do
|
48
|
+
it_should_raise_an_exception
|
49
|
+
end
|
50
|
+
end
|
51
|
+
for_attribute(:disallow_cropping) do
|
52
|
+
with_value(true) do
|
53
|
+
it_should_assign_successfully
|
54
|
+
it_should_output "<a:picLocks noCrop=\"true\"/>"
|
55
|
+
end
|
56
|
+
|
57
|
+
with_value(:not_a_boolean) do
|
58
|
+
it_should_raise_an_exception
|
59
|
+
end
|
60
|
+
end
|
61
|
+
for_attribute(:disallow_editing_points) do
|
62
|
+
with_value(true) do
|
63
|
+
it_should_assign_successfully
|
64
|
+
it_should_output "<a:picLocks noEditPoints=\"true\"/>"
|
65
|
+
end
|
66
|
+
|
67
|
+
with_value(:not_a_boolean) do
|
68
|
+
it_should_raise_an_exception
|
69
|
+
end
|
70
|
+
end
|
71
|
+
for_attribute(:disallow_grouping) do
|
72
|
+
with_value(true) do
|
73
|
+
it_should_assign_successfully
|
74
|
+
it_should_output "<a:picLocks noGrp=\"true\"/>"
|
75
|
+
end
|
76
|
+
|
77
|
+
with_value(:not_a_boolean) do
|
78
|
+
it_should_raise_an_exception
|
79
|
+
end
|
80
|
+
end
|
81
|
+
for_attribute(:disallow_moving) do
|
82
|
+
with_value(true) do
|
83
|
+
it_should_assign_successfully
|
84
|
+
it_should_output "<a:picLocks noMove=\"true\"/>"
|
85
|
+
end
|
86
|
+
|
87
|
+
with_value(:not_a_boolean) do
|
88
|
+
it_should_raise_an_exception
|
89
|
+
end
|
90
|
+
end
|
91
|
+
for_attribute(:disallow_resizing) do
|
92
|
+
with_value(true) do
|
93
|
+
it_should_assign_successfully
|
94
|
+
it_should_output "<a:picLocks noResize=\"true\"/>"
|
95
|
+
end
|
96
|
+
|
97
|
+
with_value(:not_a_boolean) do
|
98
|
+
it_should_raise_an_exception
|
99
|
+
end
|
100
|
+
end
|
101
|
+
for_attribute(:disallow_rotation) do
|
102
|
+
with_value(true) do
|
103
|
+
it_should_assign_successfully
|
104
|
+
it_should_output "<a:picLocks noRot=\"true\"/>"
|
105
|
+
end
|
106
|
+
|
107
|
+
with_value(:not_a_boolean) do
|
108
|
+
it_should_raise_an_exception
|
109
|
+
end
|
110
|
+
end
|
111
|
+
for_attribute(:disallow_selection) do
|
112
|
+
with_value(true) do
|
113
|
+
it_should_assign_successfully
|
114
|
+
it_should_output "<a:picLocks noSelect=\"true\"/>"
|
115
|
+
end
|
116
|
+
|
117
|
+
with_value(:not_a_boolean) do
|
118
|
+
it_should_raise_an_exception
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::DrawingML::Elements::PictureShapeProperties do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :spPr, name: "picture_shape_properties"
|
7
|
+
|
8
|
+
for_attribute(:black_and_white_mode) do
|
9
|
+
%i(auto black blackGray blackWhite clr gray grayWhite hidden invGray ltGray white).each do |good_value|
|
10
|
+
with_value(good_value) do
|
11
|
+
it_should_assign_successfully
|
12
|
+
it_should_output "<pic:spPr bwMode=\"#{good_value}\"/>"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
with_value(:disallowed_value) do
|
17
|
+
it_should_raise_an_exception
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::DrawingML::Elements::SourceRectangle do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :srcRect, name: "source_rectangle"
|
7
|
+
|
8
|
+
for_attribute(:bottom_offset) do
|
9
|
+
with_value("10%") do
|
10
|
+
it_should_assign_successfully
|
11
|
+
it_should_output "<a:srcRect b=\"10%\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_value("10.1%") do
|
15
|
+
it_should_assign_successfully
|
16
|
+
it_should_output "<a:srcRect b=\"10.1%\"/>"
|
17
|
+
end
|
18
|
+
|
19
|
+
with_values(["10", 10, "%"]) do
|
20
|
+
it_should_raise_an_exception
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
for_attribute(:left_offset) do
|
25
|
+
with_value("10%") do
|
26
|
+
it_should_assign_successfully
|
27
|
+
it_should_output "<a:srcRect l=\"10%\"/>"
|
28
|
+
end
|
29
|
+
|
30
|
+
with_value("10.1%") do
|
31
|
+
it_should_assign_successfully
|
32
|
+
it_should_output "<a:srcRect l=\"10.1%\"/>"
|
33
|
+
end
|
34
|
+
|
35
|
+
with_values(["10", 10, "%"]) do
|
36
|
+
it_should_raise_an_exception
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
for_attribute(:right_offset) do
|
41
|
+
with_value("10%") do
|
42
|
+
it_should_assign_successfully
|
43
|
+
it_should_output "<a:srcRect r=\"10%\"/>"
|
44
|
+
end
|
45
|
+
|
46
|
+
with_value("10.1%") do
|
47
|
+
it_should_assign_successfully
|
48
|
+
it_should_output "<a:srcRect r=\"10.1%\"/>"
|
49
|
+
end
|
50
|
+
|
51
|
+
with_values(["10", 10, "%"]) do
|
52
|
+
it_should_raise_an_exception
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
for_attribute(:top_offset) do
|
57
|
+
with_value("10%") do
|
58
|
+
it_should_assign_successfully
|
59
|
+
it_should_output "<a:srcRect t=\"10%\"/>"
|
60
|
+
end
|
61
|
+
|
62
|
+
with_value("10.1%") do
|
63
|
+
it_should_assign_successfully
|
64
|
+
it_should_output "<a:srcRect t=\"10.1%\"/>"
|
65
|
+
end
|
66
|
+
|
67
|
+
with_values(["10", 10, "%"]) do
|
68
|
+
it_should_raise_an_exception
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
with_no_attributes_set do
|
73
|
+
it_should_output "<a:srcRect/>", assign: false
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::Docx::Elements::EmbedSystemFonts do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :embedSystemFonts, name: "embed_system_fonts"
|
7
|
+
|
8
|
+
for_attribute(:value) do
|
9
|
+
with_value(true) do
|
10
|
+
it_should_assign_successfully
|
11
|
+
it_should_output "<w:embedSystemFonts w:val=\"true\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_value(:somethingElse) do
|
15
|
+
it_should_raise_an_exception
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::Docx::Elements::EmbedTrueTypeFonts do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :embedTrueTypeFonts, name: "embed_true_type_fonts"
|
7
|
+
|
8
|
+
for_attribute(:value) do
|
9
|
+
with_value(true) do
|
10
|
+
it_should_assign_successfully
|
11
|
+
it_should_output "<w:embedTrueTypeFonts w:val=\"true\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_value(:somethingElse) do
|
15
|
+
it_should_raise_an_exception
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::Docx::Elements::FontAlternateName do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :altName, name: "font_alternate_name"
|
7
|
+
|
8
|
+
for_attribute(:value) do
|
9
|
+
with_value("String Font Name") do
|
10
|
+
it_should_assign_successfully
|
11
|
+
it_should_output "<w:altName w:val=\"String Font Name\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_value(:somethingElse) do
|
15
|
+
it_should_raise_an_exception
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::Docx::Elements::FontCharacterSet do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :charset, name: "font_character_set"
|
7
|
+
|
8
|
+
for_attribute(:character_set) do
|
9
|
+
with_value("String") do
|
10
|
+
it_should_assign_successfully
|
11
|
+
it_should_output "<w:charset w:characterSet=\"String\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_value(:somethingElse) do
|
15
|
+
it_should_raise_an_exception
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::Docx::Elements::FontPanoseOne do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :panose1, name: "font_panose_one"
|
7
|
+
|
8
|
+
for_attribute(:value) do
|
9
|
+
with_value("ABCDE1234567890") do
|
10
|
+
it_should_assign_successfully
|
11
|
+
it_should_output "<w:panose1 w:val=\"ABCDE1234567890\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_value("Not a string of hex digits") do
|
15
|
+
it_should_raise_an_exception
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::Docx::Elements::FontPitch do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :pitch, name: "font_pitch"
|
7
|
+
|
8
|
+
for_attribute(:value) do
|
9
|
+
%i(default fixed variable).each do |good_value|
|
10
|
+
with_value(good_value) do
|
11
|
+
it_should_assign_successfully
|
12
|
+
it_should_output "<w:pitch w:val=\"#{good_value}\"/>"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
with_value(:bad_value) do
|
17
|
+
it_should_raise_an_exception
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::Docx::Elements::FontSig do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :sig, name: "font_sig"
|
7
|
+
|
8
|
+
for_attribute(:csb0) do
|
9
|
+
with_value("F0E1B2E3") do
|
10
|
+
it_should_assign_successfully
|
11
|
+
it_should_output "<w:sig w:csb0=\"F0E1B2E3\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_values(["FF","Not Hex","FFFFFFFFFF"]) do
|
15
|
+
it_should_raise_an_exception
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
for_attribute(:csb1) do
|
20
|
+
with_value("F0E1B2E3") do
|
21
|
+
it_should_assign_successfully
|
22
|
+
it_should_output "<w:sig w:csb1=\"F0E1B2E3\"/>"
|
23
|
+
end
|
24
|
+
|
25
|
+
with_values(["FF","Not Hex","FFFFFFFFFF"]) do
|
26
|
+
it_should_raise_an_exception
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
for_attribute(:usb0) do
|
31
|
+
with_value("F0E1B2E3") do
|
32
|
+
it_should_assign_successfully
|
33
|
+
it_should_output "<w:sig w:usb0=\"F0E1B2E3\"/>"
|
34
|
+
end
|
35
|
+
|
36
|
+
with_values(["FF","Not Hex","FFFFFFFFFF"]) do
|
37
|
+
it_should_raise_an_exception
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
for_attribute(:usb1) do
|
42
|
+
with_value("F0E1B2E3") do
|
43
|
+
it_should_assign_successfully
|
44
|
+
it_should_output "<w:sig w:usb1=\"F0E1B2E3\"/>"
|
45
|
+
end
|
46
|
+
|
47
|
+
with_values(["FF","Not Hex","FFFFFFFFFF"]) do
|
48
|
+
it_should_raise_an_exception
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
for_attribute(:usb2) do
|
53
|
+
with_value("F0E1B2E3") do
|
54
|
+
it_should_assign_successfully
|
55
|
+
it_should_output "<w:sig w:usb2=\"F0E1B2E3\"/>"
|
56
|
+
end
|
57
|
+
|
58
|
+
with_values(["FF","Not Hex","FFFFFFFFFF"]) do
|
59
|
+
it_should_raise_an_exception
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
for_attribute(:usb3) do
|
64
|
+
with_value("F0E1B2E3") do
|
65
|
+
it_should_assign_successfully
|
66
|
+
it_should_output "<w:sig w:usb3=\"F0E1B2E3\"/>"
|
67
|
+
end
|
68
|
+
|
69
|
+
with_values(["FF","Not Hex","FFFFFFFFFF"]) do
|
70
|
+
it_should_raise_an_exception
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|