ref: refs/heads/master
commit d60f8436baab2c318d8c1c1e758a23bb28ec21fa
Author: Martin Vidner
Date: Tue Sep 15 11:07:01 2009 +0200
Test serialization of string arrays.
---
.../network/test/unit/array_serialization_test.rb | 28 ++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/plugins/network/test/unit/array_serialization_test.rb b/plugins/network/test/unit/array_serialization_test.rb
new file mode 100644
index 0000000..118b42d
--- /dev/null
+++ b/plugins/network/test/unit/array_serialization_test.rb
@@ -0,0 +1,28 @@
+require 'test_helper'
+require 'string_serialization'
+
+class ArraySerializationTest < Test::Unit::TestCase
+
+ def setup
+ @options = {:skip_instruct => true, :indent => 0}
+ end
+
+ def test_string_array
+ a = ["foo", "bar"]
+ assert_equal "<string>foo</string><string>bar</string></strings>", a.to_xml(@options)
+ end
+
+ # avoid <nil-classes>
+ def test_empty_array_of_strings
+ a = []
+ assert_equal "", a.to_xml(@options.merge(:root => "strings"))
+ end
+
+ # to make karmi happy ;-)
+ def test_array_of_empty_strings
+ a = ["", ""]
+ assert_equal "<string></string><string></string></strings>", a.to_xml(@options)
+ end
+
+ # numbers still fail but we don't care
+end
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org