Sha256: f33b5ed7ad044852a95580d0752bb3f748d90f44faa375b4cb19afbd43101d2c

Contents?: true

Size: 1.36 KB

Versions: 15

Compression:

Stored size: 1.36 KB

Contents

# encoding: ASCII-8BIT
require 'helper'
require 'testutil'
require 'soap/marshal'
require 'rbconfig'


module WSDL; module SOAP


class TestSection < Test::Unit::TestCase
  DIR = File.dirname(File.expand_path(__FILE__))
  RUBY = Config::CONFIG['RUBY_INSTALL_NAME']

  def setup
    system("cd #{DIR} && #{RUBY} #{pathname("../../../../../bin/xsd2ruby.rb")} --xsd #{pathname("section.xsd")} --classdef --force --quiet")
  end

  def teardown
    File.unlink(pathname("mysample.rb")) unless $DEBUG
  end

  def test_classdef
    compare("expectedClassdef.rb", "mysample.rb")
  end

  def test_marshal
    # avoid name crash (<item> => an Item when a class Item is defined)
    if ::Object.constants.include?("Item")
      ::Object.instance_eval { remove_const("Item") }
    end
    TestUtil.require(DIR, 'mysample.rb')
    s1 = Section.new(1, "section1", "section 1", 1001, Question.new("q1"))
    s2 = Section.new(2, "section2", "section 2", 1002, Question.new("q2"))
    org = SectionArray[s1, s2]
    obj = ::SOAP::Marshal.unmarshal(::SOAP::Marshal.marshal(org))
    assert_equal(SectionArray, obj.class)
    assert_equal(Section, obj[0].class)
    assert_equal(Question, obj[0].firstQuestion.class)
  end

private

  def pathname(filename)
    File.join(DIR, filename)
  end

  def compare(expected, actual)
    TestUtil.filecompare(pathname(expected), pathname(actual))
  end
end


end; end

Version data entries

15 entries across 15 versions & 9 rubygems

Version Path
malagant-soap4r-1.5.8.20141127181857 test/wsdl/soap/wsdl2ruby/section/test_section.rb
rtiss_soap4r-1.6.1 test/wsdl/soap/wsdl2ruby/section/test_section.rb
rtiss_soap4r-1.6.0 test/wsdl/soap/wsdl2ruby/section/test_section.rb
eSpace_soap4r-1.5.8 test/wsdl/soap/wsdl2ruby/section/test_section.rb
soap4r-ruby19-1.5.9 test/wsdl/soap/wsdl2ruby/section/test_section.rb
tomdz-soap4r-1.5.8.20120202093209 test/wsdl/soap/wsdl2ruby/section/test_section.rb
soap5r-2.0.3 test/wsdl/soap/wsdl2ruby/section/test_section.rb
soap5r-2.0.2 test/wsdl/soap/wsdl2ruby/section/test_section.rb
soap5r-2.0.1 test/wsdl/soap/wsdl2ruby/section/test_section.rb
soap5r-2.0.0 test/wsdl/soap/wsdl2ruby/section/test_section.rb
soap5r-2.0.0.20120130130121 test/wsdl/soap/wsdl2ruby/section/test_section.rb
soap4r-sgonyea-1.5.9 test/wsdl/soap/wsdl2ruby/section/test_section.rb
sunteya-soap4r-1.5.8.0 test/wsdl/soap/wsdl2ruby/section/test_section.rb
tomdz-soap4r-1.5.8.20111103171510 test/wsdl/soap/wsdl2ruby/section/test_section.rb
rubyjedi-soap4r-1.5.8.20100619003610 test/wsdl/soap/wsdl2ruby/section/test_section.rb