Sha256: 952bfa959cef33ea28371909196d8a4a27dfeff1ea99e085695a77ef5ae71444

Contents?: true

Size: 1009 Bytes

Versions: 441

Compression:

Stored size: 1009 Bytes

Contents

require "helper"

module XSD
  module XMLParser
    class Parser
      @factory_added = nil

      class << self; attr_reader :factory_added; end

      def self.add_factory o
        @factory_added = o
      end

      def initialize *args
        @charset = nil
      end

      def characters foo
      end

      def start_element *args
      end

      def end_element *args
      end
    end
  end
end

require 'xsd/xmlparser/nokogiri'

class TestSoap4rSax < Nokogiri::TestCase
  def test_factory_added
    assert_equal XSD::XMLParser::Nokogiri, XSD::XMLParser::Nokogiri.factory_added
  end

  def test_parse
    o = Class.new(::XSD::XMLParser::Nokogiri) do
      attr_accessor :element_started
      def initialize *args
        super
        @element_started = false
      end

      def start_element *args
        @element_started = true
      end
    end.new 'foo'
    o.do_parse '<?xml version="1.0" ?><root xmlns="http://example.com/"/>'
    assert o.element_started, 'element started'
  end
end

Version data entries

441 entries across 431 versions & 40 rubygems

Version Path
nokogiri-1.7.0-x64-mingw32 test/test_soap4r_sax.rb
nokogiri-1.7.0-java test/test_soap4r_sax.rb
nokogiri-1.6.8.1 test/test_soap4r_sax.rb
nokogiri-1.6.8.1-x86-mingw32 test/test_soap4r_sax.rb
nokogiri-1.6.8.1-x64-mingw32 test/test_soap4r_sax.rb
nokogiri-1.6.8.1-java test/test_soap4r_sax.rb
tdiary-5.0.2 vendor/bundle/gems/nokogiri-1.6.8/test/test_soap4r_sax.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.1/test/test_soap4r_sax.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.1/test/test_soap4r_sax.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.1/test/test_soap4r_sax.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.1/test/test_soap4r_sax.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.7.2/test/test_soap4r_sax.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/test/test_soap4r_sax.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/test/test_soap4r_sax.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.7.2/test/test_soap4r_sax.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.7.2/test/test_soap4r_sax.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/test/test_soap4r_sax.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.7.2/test/test_soap4r_sax.rb
tdiary-5.0.1 vendor/bundle/gems/nokogiri-1.6.8/test/test_soap4r_sax.rb
nokogiri-1.6.8 test/test_soap4r_sax.rb