Sha256: 2e504120c814d61acda6ebfb755e052869b0bc1165336682cd66b21673e495ce

Contents?: true

Size: 817 Bytes

Versions: 127

Compression:

Stored size: 817 Bytes

Contents

require "helper"

module Nokogiri
  module XML
    class TestSyntaxError < Nokogiri::TestCase
      def test_new
        error = Nokogiri::XML::SyntaxError.new 'hello'
        assert_equal 'hello', error.message
      end

      def test_pushing_to_array
        reader = Nokogiri::XML::Reader(StringIO.new('&bogus;'))
        assert_raises(SyntaxError) {
          reader.read
        }
        assert_equal [SyntaxError], reader.errors.map(&:class) unless Nokogiri.jruby? # needs investigation
      end

      def test_pushing_to_non_array
        reader = Nokogiri::XML::Reader(StringIO.new('&bogus;'))
        def reader.errors
          1
        end
        assert_raises(TypeError) {
          reader.read
        }
      end unless Nokogiri.jruby? # which does not internally call `errors`
    end
  end
end

Version data entries

127 entries across 123 versions & 13 rubygems

Version Path
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/nokogiri-1.7.1/test/xml/test_syntax_error.rb
tdiary-5.0.5 vendor/bundle/gems/nokogiri-1.7.1/test/xml/test_syntax_error.rb
nokogiri-1.7.2 test/xml/test_syntax_error.rb
nokogiri-1.7.2-x86-mingw32 test/xml/test_syntax_error.rb
nokogiri-1.7.2-x64-mingw32 test/xml/test_syntax_error.rb
nokogiri-1.7.2-java test/xml/test_syntax_error.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/nokogiri-1.7.1/test/xml/test_syntax_error.rb
tdiary-5.0.4 vendor/bundle/gems/nokogiri-1.7.1/test/xml/test_syntax_error.rb
nokogiri-1.7.1 test/xml/test_syntax_error.rb
nokogiri-1.7.1-x86-mingw32 test/xml/test_syntax_error.rb
nokogiri-1.7.1-x64-mingw32 test/xml/test_syntax_error.rb
nokogiri-1.7.1-java test/xml/test_syntax_error.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.7.0.1/test/xml/test_syntax_error.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.7.0.1/test/xml/test_syntax_error.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.7.0.1/test/xml/test_syntax_error.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.7.0.1/test/xml/test_syntax_error.rb
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.7.0.1/test/xml/test_syntax_error.rb
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.7.0.1/test/xml/test_syntax_error.rb
autocompl-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.7.0.1/test/xml/test_syntax_error.rb
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/nokogiri-1.6.8.1/test/xml/test_syntax_error.rb