Sha256: 43ed535f475be0112c5645fefc6482bd5d42e2327db54c62bd3aafc14b76be39

Contents?: true

Size: 616 Bytes

Versions: 50

Compression:

Stored size: 616 Bytes

Contents

require "helper"

module Nokogiri
  class TestSlop < Nokogiri::TestCase
    def test_description_tag
      doc = Nokogiri.Slop(<<-eoxml)
        <item>
          <title>foo</title>
          <description>this is the foo thing</description>
        </item>
      eoxml

      assert doc.item.respond_to?(:title)
      assert_equal 'foo', doc.item.title.text

      assert doc.item.respond_to?(:_description), 'should have description'
      assert_equal 'this is the foo thing', doc.item._description.text

      assert !doc.item.respond_to?(:foo)
      assert_raise(NoMethodError) { doc.item.foo }
    end
  end
end

Version data entries

50 entries across 45 versions & 5 rubygems

Version Path
tdiary-5.0.11 vendor/bundle/gems/nokogiri-1.8.4/test/decorators/test_slop.rb
tdiary-5.0.11 vendor/bundle/gems/nokogiri-1.8.5/test/decorators/test_slop.rb
nokogiri-1.9.0.rc1 test/decorators/test_slop.rb
nokogiri-1.9.0.rc1-x86-mingw32 test/decorators/test_slop.rb
nokogiri-1.9.0.rc1-x64-mingw32 test/decorators/test_slop.rb
nokogiri-1.9.0.rc1-java test/decorators/test_slop.rb
nokogiri-1.8.5 test/decorators/test_slop.rb
nokogiri-1.8.5-x86-mingw32 test/decorators/test_slop.rb
nokogiri-1.8.5-x64-mingw32 test/decorators/test_slop.rb
nokogiri-1.8.5-java test/decorators/test_slop.rb
daslabs-0.12.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/test/decorators/test_slop.rb
daslabs-0.11.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/test/decorators/test_slop.rb
nokogiri-1.8.4 test/decorators/test_slop.rb
nokogiri-1.8.4-x86-mingw32 test/decorators/test_slop.rb
nokogiri-1.8.4-x64-mingw32 test/decorators/test_slop.rb
nokogiri-1.8.4-java test/decorators/test_slop.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.3/test/decorators/test_slop.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/nokogiri-1.8.3/test/decorators/test_slop.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/nokogiri-1.8.3/test/decorators/test_slop.rb
tdiary-5.0.9 vendor/bundle/gems/nokogiri-1.8.2/test/decorators/test_slop.rb