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
tdiary-5.0.11 vendor/bundle/gems/nokogiri-1.8.4/test/test_soap4r_sax.rb
tdiary-5.0.11 vendor/bundle/gems/nokogiri-1.8.5/test/test_soap4r_sax.rb
nokogiri-1.9.0.rc1 test/test_soap4r_sax.rb
nokogiri-1.9.0.rc1-x86-mingw32 test/test_soap4r_sax.rb
nokogiri-1.9.0.rc1-x64-mingw32 test/test_soap4r_sax.rb
nokogiri-1.9.0.rc1-java test/test_soap4r_sax.rb
nokogiri-1.8.5 test/test_soap4r_sax.rb
nokogiri-1.8.5-x86-mingw32 test/test_soap4r_sax.rb
nokogiri-1.8.5-x64-mingw32 test/test_soap4r_sax.rb
nokogiri-1.8.5-java test/test_soap4r_sax.rb
daslabs-0.12.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/test/test_soap4r_sax.rb
daslabs-0.11.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/test/test_soap4r_sax.rb
nokogiri-1.8.4 test/test_soap4r_sax.rb
nokogiri-1.8.4-x86-mingw32 test/test_soap4r_sax.rb
nokogiri-1.8.4-x64-mingw32 test/test_soap4r_sax.rb
nokogiri-1.8.4-java test/test_soap4r_sax.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.3/test/test_soap4r_sax.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/nokogiri-1.8.3/test/test_soap4r_sax.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/nokogiri-1.8.3/test/test_soap4r_sax.rb
tdiary-5.0.9 vendor/bundle/gems/nokogiri-1.8.2/test/test_soap4r_sax.rb