Sha256: 984f08461a7c2963c9ffdd331a62c36c4f28a9a9ed094f9bcc1f9012a42b97ce

Contents?: true

Size: 710 Bytes

Versions: 375

Compression:

Stored size: 710 Bytes

Contents

# issue#560

require 'helper'

module Nokogiri
  module XML
    class TestNodeInheritance < Nokogiri::TestCase
      MyNode = Class.new Nokogiri::XML::Node
      def setup
        super
        @node = MyNode.new 'foo', Nokogiri::XML::Document.new
        @node['foo'] = 'bar' 
      end

      def test_node_name
        assert @node.name == 'foo'
      end

      def test_node_writing_an_attribute_accessing_via_attributes 
        assert @node.attributes['foo']
      end

      def test_node_writing_an_attribute_accessing_via_key 
        assert @node.key? 'foo'
      end

      def test_node_writing_an_attribute_accessing_via_brackets 
        assert @node['foo'] == 'bar'
      end
    end
  end
end

Version data entries

375 entries across 365 versions & 30 rubygems

Version Path
nokogiri-1.8.3 test/xml/test_node_inheritance.rb
nokogiri-1.8.3-x86-mingw32 test/xml/test_node_inheritance.rb
nokogiri-1.8.3-x64-mingw32 test/xml/test_node_inheritance.rb
nokogiri-1.8.3-java test/xml/test_node_inheritance.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/nokogiri-1.8.1/test/xml/test_node_inheritance.rb
tdiary-5.0.8 vendor/bundle/gems/nokogiri-1.8.2/test/xml/test_node_inheritance.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/nokogiri-1.8.2/test/xml/test_node_inheritance.rb
daslabs-0.10.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/test/xml/test_node_inheritance.rb
daslabs-0.9.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/test/xml/test_node_inheritance.rb
daslabs-0.8.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/test/xml/test_node_inheritance.rb
daslabs-0.7.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/test/xml/test_node_inheritance.rb
daslabs-0.6.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/test/xml/test_node_inheritance.rb
daslabs-0.5.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/test/xml/test_node_inheritance.rb
daslabs-0.4.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/test/xml/test_node_inheritance.rb
nokogiri-1.8.2 test/xml/test_node_inheritance.rb
nokogiri-1.8.2-x86-mingw32 test/xml/test_node_inheritance.rb
nokogiri-1.8.2-x64-mingw32 test/xml/test_node_inheritance.rb
nokogiri-1.8.2-java test/xml/test_node_inheritance.rb
tdiary-5.0.7 vendor/bundle/gems/nokogiri-1.8.1/test/xml/test_node_inheritance.rb
pract6-0.1.0 .gem/ruby/2.3.0/gems/nokogiri-1.8.1/test/xml/test_node_inheritance.rb