From 1e760c0be3ed35874204114e7454509f740c0fe2 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Wed, 22 Aug 2007 01:53:51 +0000 Subject: add tag v1_8_6_71 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_8_5_71@13189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby_1_8_6/test/soap/test_no_indent.rb | 86 ++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 ruby_1_8_6/test/soap/test_no_indent.rb (limited to 'ruby_1_8_6/test/soap/test_no_indent.rb') diff --git a/ruby_1_8_6/test/soap/test_no_indent.rb b/ruby_1_8_6/test/soap/test_no_indent.rb new file mode 100644 index 0000000000..f49fb7389f --- /dev/null +++ b/ruby_1_8_6/test/soap/test_no_indent.rb @@ -0,0 +1,86 @@ +require 'test/unit' +require 'soap/rpc/standaloneServer' +require 'soap/rpc/driver' + +if defined?(HTTPAccess2) + +module SOAP + + +class TestNoIndent < Test::Unit::TestCase + Port = 17171 + + class NopServer < SOAP::RPC::StandaloneServer + def initialize(*arg) + super + add_rpc_method(self, 'nop') + end + + def nop + SOAP::RPC::SOAPVoid.new + end + end + + def setup + @server = NopServer.new(self.class.name, nil, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @t = Thread.new { + @server.start + } + @endpoint = "http://localhost:#{Port}/" + @client = SOAP::RPC::Driver.new(@endpoint) + @client.add_rpc_method('nop') + end + + def teardown + @server.shutdown + @t.kill + @t.join + @client.reset_stream + end + + INDENT_XML = +%q[ + + + + + +] + + NO_INDENT_XML = +%q[ + + + + + +] + + def test_indent + @client.wiredump_dev = str = '' + @client.options["soap.envelope.no_indent"] = false + @client.nop + assert_equal(INDENT_XML, parse_requestxml(str)) + end + + def test_no_indent + @client.wiredump_dev = str = '' + @client.options["soap.envelope.no_indent"] = true + @client.nop + assert_equal(NO_INDENT_XML, parse_requestxml(str)) + end + + def parse_requestxml(str) + str.split(/\r?\n\r?\n/)[3] + end +end + + +end + +end -- cgit v1.2.3