Skip to content

Commit 4ea420c

Browse files
committed
Add test for Volume#to_xml
1 parent b073ac7 commit 4ea420c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/libvirt/models/compute/volume_tests.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,23 @@
3535
test('succeed') { volume.xml == new_vol.xml }
3636
end
3737

38+
test('to_xml') do
39+
test('default') do
40+
expected = <<~VOLUME
41+
<volume>
42+
<name>fog_test</name>
43+
<allocation unit="G">1</allocation>
44+
<capacity unit="G">10</capacity>
45+
<target>
46+
<format type="raw"/>
47+
<permissions>
48+
<mode>0744</mode>
49+
<label>virt_image_t</label>
50+
</permissions>
51+
</target>
52+
</volume>
53+
VOLUME
54+
volume.to_xml == expected
55+
end
56+
end
3857
end

0 commit comments

Comments
 (0)