Mailinglist Archive: yast-commit (2114 mails)

< Previous Next >
[yast-commit] <web-client> master : Test serialization of string arrays.
  • From: Martin Vidner <mvidner@xxxxxxx>
  • Date: Tue, 15 Sep 2009 11:07:01 +0200
  • Message-id: <E1Mo1tZ-0001ld-Ns@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit d60f8436baab2c318d8c1c1e758a23bb28ec21fa
Author: Martin Vidner <mvidner@xxxxxxx>
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 "<strings
type=\"array\"><string>foo</string><string>bar</string></strings>",
a.to_xml(@options)
+ end
+
+ # avoid <nil-classes>
+ def test_empty_array_of_strings
+ a = []
+ assert_equal "<strings type=\"array\"/>", a.to_xml(@options.merge(:root =>
"strings"))
+ end
+
+ # to make karmi happy ;-)
+ def test_array_of_empty_strings
+ a = ["", ""]
+ assert_equal "<strings
type=\"array\"><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@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages