Sha256: 93df6625102094311cf9486950a1da5d14c7859c4173f4a37552bb89c54d6fd8

Contents?: true

Size: 665 Bytes

Versions: 282

Compression:

Stored size: 665 Bytes

Contents

require "helper"

module Nokogiri
  module XML
    class TestComment < Nokogiri::TestCase
      def setup
        super
        @xml = Nokogiri::XML.parse(File.read(XML_FILE), XML_FILE)
      end

      def test_new
        comment = Nokogiri::XML::Comment.new(@xml, 'hello world')
        assert_equal('<!--hello world-->', comment.to_s)
      end

      def test_comment?
        comment = Nokogiri::XML::Comment.new(@xml, 'hello world')
        assert(comment.comment?)
        assert(!@xml.root.comment?)
      end

      def test_many_comments
        100.times {
          Nokogiri::XML::Comment.new(@xml, 'hello world')
        }
      end
    end
  end
end

Version data entries

282 entries across 282 versions & 27 rubygems

Version Path
rubyjobbuilderdsl-0.0.2 vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_comment.rb
rubyjobbuilderdsl-0.0.1 vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_comment.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/nokogiri-1.6.3.1-x86-mingw32/test/xml/test_comment.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/nokogiri-1.6.3.1/test/xml/test_comment.rb
nokogiri-1.6.5 test/xml/test_comment.rb
nokogiri-1.6.5-x86-mingw32 test/xml/test_comment.rb
nokogiri-1.6.5-x64-mingw32 test/xml/test_comment.rb
nokogiri-1.6.5-java test/xml/test_comment.rb
nokogiri-1.6.4.1 test/xml/test_comment.rb
nokogiri-1.6.4.1-x86-mingw32 test/xml/test_comment.rb
nokogiri-1.6.4.1-x64-mingw32 test/xml/test_comment.rb
nokogiri-1.6.4.1-java test/xml/test_comment.rb
nokogiri-1.6.4 test/xml/test_comment.rb
nokogiri-1.6.4-x86-mingw32 test/xml/test_comment.rb
nokogiri-1.6.4-x64-mingw32 test/xml/test_comment.rb
nokogiri-1.6.4-java test/xml/test_comment.rb
nokogiri-1.6.3.1 test/xml/test_comment.rb
nokogiri-1.6.3.1-x86-mingw32 test/xml/test_comment.rb
nokogiri-1.6.3.1-x64-mingw32 test/xml/test_comment.rb
nokogiri-1.6.3.1-java test/xml/test_comment.rb