summaryrefslogtreecommitdiff
path: root/test/rexml/test_element.rb
blob: 82830b44e6ae2c9dc341460d0af2426aade7a867 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: false

require "test/unit/testcase"
require "rexml/document"

module REXMLTests
  class ElementTester < Test::Unit::TestCase
    def test_array_reference_string
      doc = REXML::Document.new("<language name='Ruby'/>")
      assert_equal("Ruby", doc.root["name"])
    end

    def test_array_reference_symbol
      doc = REXML::Document.new("<language name='Ruby'/>")
      assert_equal("Ruby", doc.root[:name])
    end
  end
end